public override async Task <bool> IsTwoFactorClientRememberedAsync(TUser user) { var result = await Context.Authentication.AuthenticateAsync(Options.Cookies.TwoFactorRememberMeCookieAuthenticationScheme); return(result != null && result.FindFirstValue(ClaimTypes.Name) == user.Id.ToString() && StudioXZeroClaimsIdentityHelper.GetTenantId(result) == user.TenantId); }
public async Task <int?> GetVerifiedTenantIdAsync() { var principal = await Context.Authentication.AuthenticateAsync(Options.Cookies.TwoFactorUserIdCookieAuthenticationScheme); if (principal == null) { return(null); } return(StudioXZeroClaimsIdentityHelper.GetTenantId(principal)); }