Hi everyone,
I’m using Auth0 version ^5.0.0-beta.3
with Expo + React Native, and I’m encountering an issue during the authentication flow.
In our app, we don’t use traditional username/password login. Instead, we have two steps for verifying the user:
- The user enters their email, and we send a verification code to confirm the email address.
- Immediately afterward, they enter their phone number, and we send a verification code via SMS.
This flow is sequential, and the email verification is completed successfully before the phone number step.
However, when calling the following method to complete login via SMS:
tsx
const handleLoginWithPhone = useCallback(async ({ verificationCode }: VerificationFormData) => {
authClient.auth.loginWithSMS({
phoneNumber: cleanPhone,
code: verificationCode,
audience: API_HOST,
}).then((res) => {
console.log(res);
}).catch((error) => {
console.error(error.message);
const errorType = handleAuthError(error);
setError(errorType);
});
}, [phone]);
I receive the following error:
Please verify your email before logging in.
But when I check the user status via the Management API (https://{tenantDomain}/api/v2/users
), the email_verified
field is true
.
My Question:
- Is there a misconfiguration in the Auth0 Authentication settings that could be causing this?
- Is there any known issue or restriction where
loginWithSMS
still checks the email verification status even when the email is already verified? - Is there a recommended way to handle this kind of dual verification (email + SMS) in sequence without triggering this error?
Any help or guidance would be greatly appreciated.
Thanks in advance!