Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/supabase_auth/lib/src/auth_admin_mfa_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ class AuthAdminMFAApi {
/// Updates the MFA factor identified by [factorId] on the user identified
/// by [userId].
///
/// Only the fields that are given are changed. The server ignores [phone]
/// on any factor that is not a phone factor.
/// Only the fields that are given are changed. The server treats an empty
/// string as not given, so a friendly name cannot be cleared, and it
/// ignores [phone] on any factor that is not a phone factor.
Future<AuthMFAAdminUpdateFactorResponse> updateFactor({
required String userId,
required String factorId,
Expand Down
12 changes: 12 additions & 0 deletions packages/supabase_auth/test/src/auth_admin_mfa_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ void main() {
expect(response.factor.friendlyName, 'VerifiedFactor');
});

test('update factor ignores the phone on a totp factor', () async {
final response = await client.admin.mfa.updateFactor(
userId: userId2,
factorId: factorId2,
phone: '+15555550100',
);

expect(response.factor.id, factorId2);
expect(response.factor.factorType, FactorType.totp);
expect(response.factor.friendlyName, 'VerifiedFactor');
});

test('delete factor', () async {
final response = await client.admin.mfa.deleteFactor(
userId: userId2,
Expand Down
Loading