We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a17f875 commit c13ed34Copy full SHA for c13ed34
packages/gotrue/lib/src/gotrue_mfa_api.dart
@@ -56,13 +56,12 @@ class GoTrueMFAApi {
56
'factor_type': factorType.name,
57
};
58
59
- if (factorType == FactorType.totp) {
+ if (factorType == FactorType.totp && issuer != null) {
60
body['issuer'] = issuer;
61
- } else if (factorType == FactorType.phone) {
62
- if (phone == null) {
63
- throw ArgumentError('Phone number is required for phone factor type');
64
- }
+ } else if (factorType == FactorType.phone && phone != null) {
65
body['phone'] = phone;
+ } else {
+ throw ArgumentError('Invalid arguments, expected an issuer for totp factor type or phone for phone factor. type');
66
}
67
68
final data = await _fetch.request(
0 commit comments