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
Copy file name to clipboardExpand all lines: apps/docs/spec/supabase_dart_v2.yml
+28-3Lines changed: 28 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1633,9 +1633,9 @@ functions:
1633
1633
notes: |
1634
1634
This section contains methods commonly used for Multi-Factor Authentication (MFA) and are invoked behind the `supabase.auth.mfa` namespace.
1635
1635
1636
-
Currently, we only support time-based one-time password (TOTP) as the 2nd factor. We don't support recovery codes but we allow users to enroll more than 1 TOTP factor, with an upper limit of 10.
1636
+
Currently, Supabase supports time-based one-time password (TOTP) and phone verification code as the 2nd factor. Recovery codes are not supported but users can enroll multiple factors, with an upper limit of 10..
1637
1637
1638
-
Having a 2nd TOTP factor for recovery means the user doesn't have to store their recovery codes. It also reduces the attack surface since the recovery factor is usually time-limited and not a single static code.
1638
+
Having a 2nd factor for recovery frees the user of the burden of having to store their recovery codes somewhere. It also reduces the attack surface since multiple recovery codes are usually generated compared to just having 1 backup factor.
1639
1639
1640
1640
Learn more about implementing MFA on your application on our guide [here](https://supabase.com/docs/guides/auth/auth-mfa#overview).
1641
1641
- id: mfa-enroll
@@ -1644,7 +1644,7 @@ functions:
1644
1644
Starts the enrollment process for a new Multi-Factor Authentication (MFA) factor. This method creates a new `unverified` factor.
1645
1645
To verify a factor, present the QR code or secret to the user and ask them to add it to their authenticator app.
1646
1646
The user has to enter the code from their authenticator app to verify it.
1647
-
- Currently, `totp` is the only supported `factorType`. The returned `id` should be used to create a challenge.
1647
+
- Use `totp` or `phone` as the `factorType` and the returned `id` to create a challenge.
1648
1648
- To create a challenge, see [`mfa.challenge()`](/docs/reference/dart/auth-mfa-challenge).
1649
1649
- To verify a challenge, see [`mfa.verify()`](/docs/reference/dart/auth-mfa-verify).
1650
1650
- To create and verify a challenge in a single step, see [`mfa.challengeAndVerify()`](/docs/reference/dart/auth-mfa-challengeandverify).
@@ -1661,6 +1661,10 @@ functions:
1661
1661
isOptional: true
1662
1662
type: String
1663
1663
description: Human readable name assigned to the factor.
1664
+
- name: phone
1665
+
isOptional: true
1666
+
type: String
1667
+
description: Phone number to enroll for phone factor type.
1664
1668
examples:
1665
1669
- id: enroll-totp-factor
1666
1670
name: Enroll a time-based, one-time password (TOTP) factor
@@ -1681,6 +1685,27 @@ functions:
1681
1685
secret: '<SECRET>',
1682
1686
uri: '<URI>',
1683
1687
),
1688
+
phone: null,
1689
+
);
1690
+
```
1691
+
- id: enroll-phone-factor
1692
+
name: Enroll a Phone Factor
1693
+
isSpotlight: true
1694
+
code: |
1695
+
```dart
1696
+
final res = await supabase.auth.mfa.enroll(factorType: FactorType.phone, phone: '+1234567890');
Copy file name to clipboardExpand all lines: apps/docs/spec/supabase_js_v2.yml
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2128,6 +2128,8 @@ functions:
2128
2128
Currently, there is support for time-based one-time password (TOTP) and phone verification code as the 2nd factor. Recovery codes are not supported but users can enroll multiple factors, with an upper limit of 10.
2129
2129
2130
2130
Having a 2nd factor for recovery frees the user of the burden of having to store their recovery codes somewhere. It also reduces the attack surface since multiple recovery codes are usually generated compared to just having 1 backup factor.
2131
+
2132
+
Learn more about implementing MFA in your application [in the MFA guide](https://supabase.com/docs/guides/auth/auth-mfa#overview).
0 commit comments