SupabaseS
Supabase12mo ago
Symys

Supbase Client - Where to catch expired password reset email exceptions?

I'm using Flutter. I have successfully setup a deep link that opens when the user taps the Password Reset link in their email and it all works fine.

I'm trying to handle an error scenario. When the user taps on an old Password Reset link, then the app still opens but an exception occurs:

flutter: supabase.auth: WARNING: Notifying exception AuthException(message: Email link is invalid or has expired, statusCode: 403, errorCode: access_denied)


I did not call any code manually, this is the Supabase Client automatically running code when it opens with a deeplink.

Example password reset link: http://127.0.0.1:54321/auth/v1/verify?token=pkce_f3b731a3789a5aa7ea43ce8cb12b3437b425be817cdcf814023dd651&type=recovery&redirect_to=appName:/reset-password

How do I catch this error so I can handle it gracefully? The only way I can find so far is to use a runZoned() in my main.dart file, but I don't really want to do this.

Thanks for any help!
Was this page helpful?