Skip to content

Commit

Permalink
Merge pull request #320 from alexchenhz/fix/auth-email-confirmation-m…
Browse files Browse the repository at this point in the history
…essage-display

Fix(Auth): display email confirmation message after signup
  • Loading branch information
MildTomato authored Jan 26, 2022
2 parents 461bea2 + 927b9b1 commit 6dc46ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Auth/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ function EmailAuth({
if (signInError) setError(signInError.message)
break
case 'sign_up':
const { error: signUpError, data: signUpData } =
const { user: signUpUser, session: signUpSession, error: signUpError } =
await supabaseClient.auth.signUp(
{
email,
Expand All @@ -334,8 +334,8 @@ function EmailAuth({
{ redirectTo }
)
if (signUpError) setError(signUpError.message)
// checking if it has access_token to know if email verification is disabled
else if (signUpData?.hasOwnProperty('confirmation_sent_at'))
// Check if session is null -> email confirmation setting is turned on
else if (signUpUser && !signUpSession)
setMessage('Check your email for the confirmation link.')
break
}
Expand Down

0 comments on commit 6dc46ee

Please sign in to comment.