Formatting cleaning

This commit is contained in:
Florian Sylvain
2022-12-30 02:40:36 +01:00
parent 948243525e
commit 7107e4e867
+6 -4
View File
@@ -5,13 +5,13 @@ import { setCookie } from '@/utils/cookies';
import { ref, type Ref } from 'vue';
import { useRouter } from 'vue-router';
const isTokenOK: Ref<boolean|undefined> = ref(undefined)
const isTokenOK: Ref<boolean | undefined> = ref(undefined)
const router = useRouter()
const authStore = useAuthStore()
const email = ref('')
const password = ref('')
const isFormEmpty: ()=>boolean = () => {
const isFormEmpty: () => boolean = () => {
return email.value === '' || password.value === ''
}
@@ -79,12 +79,14 @@ function login(email: string, password: string): void {
</div>
<div :class="`label-input${isTokenOK === false ? '-error' : ''}`">
<label for="password">Mot de passe</label>
<input id="password" name="password" placeholder="Mot de passe" type="password" v-model="password">
<input id="password" name="password" placeholder="Mot de passe" type="password"
v-model="password">
<p v-if="isTokenOK === false"> E-mail et/ou mot de passe incorrect(s).</p>
<p v-else-if="useErrorsStore().sessionExpired"> Votre session a expiré.</p>
</div>
</div>
<button :class="`button-${isFormEmpty() ? 'disabled' : 'primary'}`" type="submit" :disabled="isFormEmpty()">
<button :class="`button-${isFormEmpty() ? 'disabled' : 'primary'}`" type="submit"
:disabled="isFormEmpty()">
Se connecter
</button>
</form>