I'm currently encountering an issue with the OTP verification process in my application using Supabase. Despite the OTP being sent and verified within the expected time frame, I'm consistently receiving an
otp_expired
otp_expired
error. Below are the details of the problem:
Flutter clinet Error Message:
AuthException(message: Token has expired or is invalid, statusCode: 403, errorCode: otp_expired).
AuthException(message: Token has expired or is invalid, statusCode: 403, errorCode: otp_expired).
What i have done is: 1. I successfully generated an OTP using Supabase's phone authentication qith HTTP auth hooks. 2. The OTP is sent to the user's phone and is typically received within seconds. 3. The user attempts to verify the OTP immediately after receiving it. 4. Despite this, the OTP verification fails with the
otp_expired
otp_expired
error.
- Expected output: The OTP should be valid and verified successfully within the standard expiry time (typically 2 minutes).
- Flutter clinet Code Snippet: Below is a snippet of the code used for OTP
- debugging steps: 1. Verified that the OTP is being sent and received correctly. 2. Ensured the OTP is being submitted well within the expiry time. 3. Reviewed the server's system time to ensure there are no discrepancies causing premature expiration. 4. Attempted manual verification by checking the OTP and expiry time directly from the database.
Could you please help me understand why this
otp_expired
otp_expired
error is occurring? Is there something i am missing to configure for time expiry?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.