1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-17 02:01:53 +01:00

2fa prem fixes

This commit is contained in:
Kyle Spearrin 2017-07-07 09:28:50 -04:00
parent 67a593c0c0
commit d3c18381f9

View File

@ -48,7 +48,7 @@ namespace Bit.Api.Controllers
[HttpPost("get-authenticator")] [HttpPost("get-authenticator")]
public async Task<TwoFactorAuthenticatorResponseModel> GetAuthenticator([FromBody]TwoFactorRequestModel model) public async Task<TwoFactorAuthenticatorResponseModel> GetAuthenticator([FromBody]TwoFactorRequestModel model)
{ {
var user = await CheckAsync(model.MasterPasswordHash, true); var user = await CheckAsync(model.MasterPasswordHash, false);
var response = new TwoFactorAuthenticatorResponseModel(user); var response = new TwoFactorAuthenticatorResponseModel(user);
return response; return response;
} }
@ -58,7 +58,7 @@ namespace Bit.Api.Controllers
public async Task<TwoFactorAuthenticatorResponseModel> PutAuthenticator( public async Task<TwoFactorAuthenticatorResponseModel> PutAuthenticator(
[FromBody]UpdateTwoFactorAuthenticatorRequestModel model) [FromBody]UpdateTwoFactorAuthenticatorRequestModel model)
{ {
var user = await CheckAsync(model.MasterPasswordHash, true); var user = await CheckAsync(model.MasterPasswordHash, false);
model.ToUser(user); model.ToUser(user);
if(!await _userManager.VerifyTwoFactorTokenAsync(user, TwoFactorProviderType.Authenticator.ToString(), model.Token)) if(!await _userManager.VerifyTwoFactorTokenAsync(user, TwoFactorProviderType.Authenticator.ToString(), model.Token))