Open
Description
Describe the bug
The verifyOTP
method requires to always have either email
or phone
to be not null. When trying to use the the method with OtpType.recovery
and specifying an email I receive AuthException(message: Only the token_hash and type should be provided, statusCode: 400, errorCode: validation_failed)
.
My workaround is to specify an empty string for email.
To Reproduce
Steps to reproduce the behavior:
This doesn't work with exception from backend.
await Supabase.instance.client.auth.verifyOTP(
email: email,
tokenHash: token,
type: OtpType.recovery,
);
Exception:
AuthException(message: Only the token_hash and type should be provided, statusCode: 400, errorCode: validation_failed)
This doesn't work with exception from supabase flutter client:
await Supabase.instance.client.auth.verifyOTP(
tokenHash: token,
type: OtpType.recovery,
);
Unhandled Exception: 'package:gotrue/src/gotrue_client.dart': Failed assertion: line 536 pos 12: '(email != null && phone == null) || (email == null && phone != null)': `email` or `phone` needs to be specified.
Expected behavior
Correct checking of which OtpType requires which parameters.