Skip to content

Commit

Permalink
feat: more clarity on authentication errors with toast
Browse files Browse the repository at this point in the history
  • Loading branch information
paranoidPhantom committed Sep 16, 2024
1 parent 58ce8f7 commit 1ebf1fe
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ async function submit() {
switch (error.status) {
case 401: {
state.value.error = "Неверные данные";
break;
}
default: {
toast.add({
id: "auth_error",
title: "Ошибка авторизации",
message: error.message,
icon: "i-heroicons-exclamation-circle",
timeout: 3000,
});
}
}
}
Expand All @@ -76,7 +86,7 @@ async function submit() {
variant="subtle"
:title="message as string"
/>
<hr class="w-1/2 opacity-10" >
<hr class="w-1/2 opacity-10" />
<UFormGroup label="Email" name="email">
<UInput v-model="state.email" placeholder="[email protected]" />
</UFormGroup>
Expand Down

0 comments on commit 1ebf1fe

Please sign in to comment.