Enhance signin flow: add toast notifications for error handling and update background color variable

This commit is contained in:
lucast committed 2025-12-05 17:39:57 +01:00
1 parent 2b368cede4
commit ce44cd03b9
4 files changed
+10 -2

No files matched your search

+6 -1
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
const auth = useAuth()
const toast = useToast()
const submit = async (e: any) => {
let data: any
@@ -8,7 +9,11 @@ const submit = async (e: any) => {
data = Object.fromEntries(new FormData(e?.target as HTMLFormElement))
} catch {}
await auth.signin(data.email, data.password, data.remember)
try {
await auth.signin(data.email, data.password, data.remember)
} catch (e: string | any) {
toast.show(e, "error")
}
}
</script>