1
0
mirror of https://github.com/bitwarden/server synced 2025-12-21 18:53:41 +00:00

[PM-12995] Create UI elements for New Device Verification in Admin Portal (#5165)

* feat(NewDeviceVerification) :
- Added constant to constants in Bit.Core because the cache key format needs to be shared between the Identity Server and the MVC project Admin.
- Updated DeviceValidator class to handle checking cache for user information to allow pass through.
- Updated and Added tests to handle new flow.
- Adding exception flow to admin project. Added tests for new methods in UserService.
This commit is contained in:
Ike
2025-01-09 18:10:54 -08:00
committed by GitHub
parent 1988f1402e
commit ce2ecf9da0
6 changed files with 253 additions and 54 deletions

View File

@@ -77,6 +77,17 @@ public interface IUserService
Task<bool> VerifyOTPAsync(User user, string token);
Task<bool> VerifySecretAsync(User user, string secret, bool isSettingMFA = false);
Task ResendNewDeviceVerificationEmail(string email, string secret);
/// <summary>
/// We use this method to check if the user has an active new device verification bypass
/// </summary>
/// <param name="userId">self</param>
/// <returns>returns true if the value is found in the cache</returns>
Task<bool> ActiveNewDeviceVerificationException(Guid userId);
/// <summary>
/// We use this method to toggle the new device verification bypass
/// </summary>
/// <param name="userId">Id of user bypassing new device verification</param>
Task ToggleNewDeviceVerificationException(Guid userId);
void SetTwoFactorProvider(User user, TwoFactorProviderType type, bool setEnabled = true);