Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabaseβ€’2y agoβ€’
12 replies
AMD

HTTP Auth hooks otp verification expiry

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

Flutter 

await supabaseClient.auth.verifiyOtp(
phone: phone, 
otp: otp
):
Flutter 

await supabaseClient.auth.verifiyOtp(
phone: phone, 
otp: 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 banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

OTP expiry settings
SupabaseSSupabase / help-and-questions
12mo ago
Supabase Unity Email OTP Session Expiry
SupabaseSSupabase / help-and-questions
2mo ago
Use auth hooks
SupabaseSSupabase / help-and-questions
3y ago
Auth Hooks error
SupabaseSSupabase / help-and-questions
3y ago