mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Formatting cleaning
This commit is contained in:
@@ -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 === ''
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ function login(email: string, password: string): void {
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
jwtHandler(result)
|
||||
if (isTokenOK.value === true) {
|
||||
if (isTokenOK.value === true) {
|
||||
router.push('/home')
|
||||
}
|
||||
})
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user