Files
Coltura/frontend/modules/core/pages/login.vue
tristan 99e96cb493
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
[#ERP-41] Mise à jour Malio UI (#10)
| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|                  |                 |

## Description de la PR

## Modification du .env

## Check list

- [ ] Pas de régression
- [x] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [ ] CHANGELOG modifié

Reviewed-on: #10
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
2026-05-13 09:03:44 +00:00

63 lines
1.6 KiB
Vue

<template>
<div class="mx-auto w-full max-w-lg">
<span
class="flex items-center justify-center bg-white text-xl font-bold uppercase text-primary-500 p-4"
>
<img src="/LOGO_MALIO.png" alt="Logo" class="w-[150px]"/>
</span>
<form
class="mt-8 space-y-6 rounded-lg border border-neutral-200 bg-white p-6 shadow-sm"
@submit.prevent="handleSubmit"
>
<MalioInputText
label="Nom d'utilisateur"
autocomplete="username"
group-class="mt-0"
input-class="w-full"
v-model="username"
/>
<MalioInputPassword
v-model="password"
label="Mot de passe"
autocomplete="current-password"
input-class="w-full"
/>
<MalioButton
label="Se connecter"
button-class="w-full"
type="submit"
:disabled="isSubmitting"
/>
<p class="font-bold">v{{ version }}</p>
</form>
</div>
</template>
<script setup lang="ts">
definePageMeta({layout: 'auth'})
useHead({
title: 'Connexion'
})
const auth = useAuthStore()
const {version} = useAppVersion()
const username = ref('')
const password = ref('')
const isSubmitting = ref(false)
async function handleSubmit() {
if (isSubmitting.value) return
isSubmitting.value = true
try {
await auth.login(username.value, password.value)
await navigateTo('/')
} finally {
isSubmitting.value = false
}
}
</script>