I am trying to add password recovery to my app. I have the change password for a logged in user working, so I am trying to set up OTP login with email via a code.
The email is received with the code from Supabase and the link I have directs to the correct OTP log in page.
I am using a custom action on a button which enacts the OTP auth. The function is below , taken from the Supabase documentation.
When I click the Log In button I get "Uncaught AuthException (message: For security purposes, you can only request this once every 60 seconds, status code: 429)
In the Supabse logs, about 30 seconds before this error, there is a 401 error, email link is invalid or has expired.
I have only requested the passcode once. Can anyone point me in generally the right direction?
Thanks
Future otpLogIn(String? email) async {
await SupaFlow.client.auth.signInWithOtp(email: email);
}