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