mirror of
https://github.com/bitwarden/server
synced 2025-12-15 15:53:59 +00:00
validate authenticator on set instead of get
This commit is contained in:
@@ -93,7 +93,7 @@ public class TwoFactorController : Controller
|
||||
public async Task<TwoFactorAuthenticatorResponseModel> GetAuthenticator(
|
||||
[FromBody] SecretVerificationRequestModel model)
|
||||
{
|
||||
var user = await CheckAsync(model, false, false);
|
||||
var user = await CheckAsync(model, false);
|
||||
var response = new TwoFactorAuthenticatorResponseModel(user);
|
||||
return response;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class TwoFactorController : Controller
|
||||
public async Task<TwoFactorAuthenticatorResponseModel> PutAuthenticator(
|
||||
[FromBody] UpdateTwoFactorAuthenticatorRequestModel model)
|
||||
{
|
||||
var user = await CheckAsync(model, false);
|
||||
var user = await CheckAsync(model, false, false);
|
||||
model.ToUser(user);
|
||||
|
||||
if (!await _userManager.VerifyTwoFactorTokenAsync(user,
|
||||
|
||||
Reference in New Issue
Block a user