File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ q-card.shadow-24.row(style="max-width: 800px;")
2727
2828<script lang="ts" setup>
2929import { ref } from ' vue'
30-
30+ import { useQuasar } from ' quasar '
3131definePageMeta ({
3232 layout: ' simple-centered' ,
3333 auth: {
@@ -36,6 +36,7 @@ definePageMeta({
3636 },
3737})
3838
39+ const $q = useQuasar ()
3940const pending = ref (false )
4041const formData = ref ({
4142 username: ' ' ,
@@ -44,9 +45,17 @@ const formData = ref({
4445
4546const submit = async () => {
4647 pending .value = true
47- await useAuth ().loginWith (' local' , {
48- body: formData .value ,
49- })
50- pending .value = false
48+ try {
49+ await useAuth ().loginWith (' local' , {
50+ body: formData .value ,
51+ })
52+ } catch (error ) {
53+ $q .notify ({
54+ type: ' negative' ,
55+ message: ' Erreur de connexion' ,
56+ })
57+ } finally {
58+ pending .value = false
59+ }
5160}
5261 </script >
You can’t perform that action at this time.
0 commit comments