Skip to content

Commit

Permalink
fix: Login form errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Oct 18, 2023
1 parent 9d527c1 commit 860dfba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/ui/user-auth-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
router.push(redirectUri)
}, 1000)
} catch (e: any) {
if (!e.response) {
setError(e.message)
return
}

if (e.response.data.message) {
setError(e.response.data.message)
} else {
Expand Down Expand Up @@ -121,9 +126,9 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
<form onSubmit={onSubmit}>
<div className="grid gap-2">
{error && (
<Alert variant="destructive">
<Alert>
<AlertCircle className="h-4 w-4" />
<AlertTitle>Hata</AlertTitle>
<AlertTitle>Bilgi</AlertTitle>
<AlertDescription>{error}</AlertDescription>
</Alert>
)}
Expand Down

0 comments on commit 860dfba

Please sign in to comment.