Enlarged access to SignInOrTwoFactorAsync (#1279)

Does https://github.com/aspnet/Identity/issues/1274
This commit is contained in:
Ponant 2017-06-14 19:52:42 +02:00 committed by Hao Kung
parent a9192d99dc
commit 98263cca29
1 changed files with 11 additions and 2 deletions

View File

@ -670,8 +670,17 @@ namespace Microsoft.AspNetCore.Identity
}
return identity;
}
private async Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string loginProvider = null, bool bypassTwoFactor = false)
/// <summary>
/// Signs in the specified <paramref name="user"/> if <paramref name="bypassTwoFactor"/> is set to false.
/// Otherwise stores the <paramref name="user"/> for use after a two factor check.
/// </summary>
/// <param name="user"></param>
/// <param name="isPersistent">Flag indicating whether the sign-in cookie should persist after the browser is closed.</param>
/// <param name="loginProvider">The login provider to use. Default is null</param>
/// <param name="bypassTwoFactor">Flag indicating whether to bypass two factor authentication. Default is false</param>
/// <returns>Returns a <see cref="SignInResult"/></returns>
protected virtual async Task<SignInResult> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string loginProvider = null, bool bypassTwoFactor = false)
{
if (!bypassTwoFactor &&
UserManager.SupportsUserTwoFactor &&