Merge branch 'feature/two-factor-auth' of github.com:ONLYOFFICE/AppServer into feature/two-factor-auth

This commit is contained in:
Viktor Fomin 2021-05-19 18:04:59 +03:00
commit 16f3b4b791
2 changed files with 14 additions and 0 deletions

View File

@ -1415,6 +1415,15 @@ namespace ASC.Api.Settings
return result;
}
[Create("tfaapp/validate")]
[Authorize(AuthenticationSchemes = "confirm", Roles = "TfaActivation,Everyone")]
public bool TfaValidateAuthCode(TfaValidateModel model)
{
ApiContext.AuthByClaim();
var user = UserManager.GetUsers(AuthContext.CurrentAccount.ID);
return TfaManager.ValidateAuthCode(user, model.Code);
}
[Read("tfaapp/confirm")]
public object TfaConfirmUrl()
{

View File

@ -7,4 +7,9 @@ namespace ASC.Web.Api.Models
public string Type { get; set; }
public Guid? Id { get; set; }
}
public class TfaValidateModel
{
public string Code { get; set; }
}
}