OTP Expired or Invalid
I verify users with email OTP using supabase.auth.signInWithOtp(), then verify the code received via email with supabase.auth.signInVerifyOTP().
For some users, verifying the code always returns an error:
AuthException(message: Token has expired or is invalid, statusCode: 403, errorCode: otp_expired)
It isn't an expiration issue as I can replicate the issue within 5 seconds of receiving the code via email. The docs (https://supabase.com/docs/guides/auth/debugging/error-codes) suggest that a 403 error code is "Sent out in rare situations where a certain Auth feature is not available for the user, and you as the developer are not checking a precondition whether that API is available for the user."
I can't find any precondition that I should be checking for when verifying an OTP sent via email, and the issue only seems to occur for certain users, although I've been unable to identify criteria for it happening.
For some users, verifying the code always returns an error:
AuthException(message: Token has expired or is invalid, statusCode: 403, errorCode: otp_expired)
It isn't an expiration issue as I can replicate the issue within 5 seconds of receiving the code via email. The docs (https://supabase.com/docs/guides/auth/debugging/error-codes) suggest that a 403 error code is "Sent out in rare situations where a certain Auth feature is not available for the user, and you as the developer are not checking a precondition whether that API is available for the user."
I can't find any precondition that I should be checking for when verifying an OTP sent via email, and the issue only seems to occur for certain users, although I've been unable to identify criteria for it happening.