aboutsummaryrefslogtreecommitdiff
path: root/plugins/VNLib.Plugins.Essentials.Accounts/src/MFA
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-09-09 19:47:51 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-09-09 19:47:51 -0400
commit0f8e932e40910bfd7172632b62c61e7dc6801b25 (patch)
tree6b1539231ca10ee5e0fada05ea2672fb83c696f0 /plugins/VNLib.Plugins.Essentials.Accounts/src/MFA
parent1fe67b21fd3e0fe9e7063cd03e43e1583fce3ce1 (diff)
session detatch support, cookie man and commands
Diffstat (limited to 'plugins/VNLib.Plugins.Essentials.Accounts/src/MFA')
-rw-r--r--plugins/VNLib.Plugins.Essentials.Accounts/src/MFA/UserMFAExtensions.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/VNLib.Plugins.Essentials.Accounts/src/MFA/UserMFAExtensions.cs b/plugins/VNLib.Plugins.Essentials.Accounts/src/MFA/UserMFAExtensions.cs
index 0b52f54..bd434ae 100644
--- a/plugins/VNLib.Plugins.Essentials.Accounts/src/MFA/UserMFAExtensions.cs
+++ b/plugins/VNLib.Plugins.Essentials.Accounts/src/MFA/UserMFAExtensions.cs
@@ -57,6 +57,16 @@ namespace VNLib.Plugins.Essentials.Accounts.MFA
return !(string.IsNullOrWhiteSpace(user[TOTP_KEY_ENTRY]) && string.IsNullOrWhiteSpace(user[WEBAUTHN_KEY_ENTRY]));
}
+ /// <summary>
+ /// Disables all forms of MFA for the current user
+ /// </summary>
+ /// <param name="user"></param>
+ public static void MFADisable(this IUser user)
+ {
+ user[TOTP_KEY_ENTRY] = null!;
+ user[WEBAUTHN_KEY_ENTRY] = null!;
+ }
+
#region totp
/// <summary>