Skip to content

Commit

Permalink
feat: added error redirect for unconfirmed emails
Browse files Browse the repository at this point in the history
  • Loading branch information
huseKivrak committed Nov 20, 2024
1 parent 2f3afe2 commit 49d056c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions actions/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,19 @@ export const signInAction = async (
password,
});
if (error) {
redirectPath = getErrorRedirect(
'/login',
'Login failed',
'Invalid email/password. Please try again.'
);
redirectPath =
//todo: resend email
error.message === 'Email not confirmed'
? getErrorRedirect(
'/login',
'unconfirmed email',
'please check your email for a confirmation link'
)
: getErrorRedirect(
'/login',
'login failed',
'invalid email/password. please try again.'
);
} else {
redirectPath = getStatusRedirect(
'/dashboard',
Expand Down

0 comments on commit 49d056c

Please sign in to comment.