supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
703 stars 166 forks source link

phone otp code resend not working #1014

Closed erkinovalim closed 2 weeks ago

erkinovalim commented 3 weeks ago

Describe the bug A clear and concise description of what the bug is. When I try to resend the otp code using the following code it gives this error:

error: flutter: verification: AuthException(message: {"code":"unexpected_failure","message":"Unable to process request"}, statusCode: 500, errorCode: null) code:

onPressed: () async {
                  try {
                    final response = await supabase.auth.resend(
                      phone: widget.phoneNumber,
                      type: OtpType.sms,
                    );

                    print('response: $response'); 
                  } catch (e) {
                    print('verification: $e');
                  }
                },

Expected behavior It should resend the code but it gives an unexpected error

Version (please complete the following information): ├── supabase_flutter 2.6.0 │ ├── supabase 2.3.0 │ │ ├── functions_client 2.3.2 │ │ ├── gotrue 2.8.4 │ │ ├── postgrest 2.1.4 │ │ ├── realtime_client 2.2.1 │ │ ├── storage_client 2.0.3

Vinzent03 commented 3 weeks ago

Are there any auth logs in the Supabase dashboard? A 500 status code is uncommon and more often not a client issue.

erkinovalim commented 2 weeks ago

It was a problem with my phone otp provider and I have fixed it. Apparently my phone number was blocked by the provider for a short time for asking to resend the code too much.