You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a parameter swapping bug with the verifyOTP() method where the email and token parameters appear to be reversed in the actual HTTP request.
Issue Description:
When calling verifyOTP() with named parameters, the values are being swapped in the network request - the email value is sent as the token, and the token value is sent as the email.
Code example:
staticFuture<AuthResponse> verifyEmailAndOtp(String email, String otp) async {
returnawait _supabaseClient.auth.verifyOTP(
type:OtpType.email,
token: otp,
email: email
);
}
// Usagetry {
final response =awaitAuthService.verifyEmailAndOtp("test@test.com", "329169");
if (response.user !=null) {
state =constAsyncData(null);
returntrue;
} else {
state =AsyncError('Verifying otp failed: No user returned', StackTrace.current);
returnfalse;
}
} catch (e, st) {
log("Registration Error: $e");
state =AsyncError(e, st);
returnfalse;
}
Uh oh!
There was an error while loading. Please reload this page.
Description:
I encountered a parameter swapping bug with the verifyOTP() method where the email and token parameters appear to be reversed in the actual HTTP request.
Issue Description:
When calling verifyOTP() with named parameters, the values are being swapped in the network request - the email value is sent as the token, and the token value is sent as the email.
Code example:
Expected request body
Actual request body after setting the httpClient
Workaround
By temporarily swapping the email and token you can get by it although it really quirky
Info
Note: I am still learning flutter. It could be that I did something wrong but based on debugging I think not.
The text was updated successfully, but these errors were encountered: