Merge branch 'feature/two-factor-auth' of github.com:ONLYOFFICE/AppServer into feature/two-factor-auth
This commit is contained in:
commit
16f3b4b791
@ -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()
|
||||
{
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user