Extracted constant for 2FA remember me cookie
This commit is contained in:
@@ -44,6 +44,11 @@
|
||||
/// The claim type for the ASP.NET Identity security stamp
|
||||
/// </summary>
|
||||
public const string SecurityStampClaimType = "AspNet.Identity.SecurityStamp";
|
||||
|
||||
/// <summary>
|
||||
/// The default authentication type used for remembering that 2FA is not needed on next login
|
||||
/// </summary>
|
||||
public const string TwoFactorRememberBrowserCookie = "TwoFactorRememberBrowser";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Owin.Security;
|
||||
using UserLoginInfo = Microsoft.AspNetCore.Identity.UserLoginInfo;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Web.Security
|
||||
{
|
||||
@@ -95,7 +95,7 @@ namespace Umbraco.Web.Security
|
||||
{
|
||||
if (manager == null) throw new ArgumentNullException(nameof(manager));
|
||||
|
||||
var rememberBrowserIdentity = new ClaimsIdentity(DefaultAuthenticationTypes.TwoFactorRememberBrowserCookie);
|
||||
var rememberBrowserIdentity = new ClaimsIdentity(Constants.Web.TwoFactorRememberBrowserCookie);
|
||||
rememberBrowserIdentity.AddClaim(new Claim(ClaimTypes.NameIdentifier, userId));
|
||||
|
||||
return rememberBrowserIdentity;
|
||||
|
||||
Reference in New Issue
Block a user