1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 08:02:49 -05:00

Added support for device registration during two factor login

This commit is contained in:
Kyle Spearrin
2016-07-23 02:49:57 -04:00
parent 452d74a266
commit d300c82ffd
3 changed files with 10 additions and 2 deletions

View File

@ -45,7 +45,7 @@ namespace Bit.Api.Controllers
[Authorize("TwoFactor")]
public async Task<AuthTokenResponseModel> PostTokenTwoFactor([FromBody]AuthTokenTwoFactorRequestModel model)
{
var result = await _signInManager.TwoFactorSignInAsync(_currentContext.User, model.Provider, model.Code);
var result = await _signInManager.TwoFactorSignInAsync(_currentContext.User, model.Provider, model.Code, model.Device?.ToDevice());
if(result == JwtBearerSignInResult.Success)
{
return new AuthTokenResponseModel(result.Token, result.User);

View File

@ -8,5 +8,6 @@ namespace Bit.Api.Models
public string Code { get; set; }
[Required]
public string Provider { get; set; }
public DeviceRequestModel Device { get; set; }
}
}