fix external login

This commit is contained in:
sbwalker
2024-09-17 11:53:34 -04:00
parent 3351732a2f
commit b0669a3b60
2 changed files with 14 additions and 13 deletions

View File

@ -32,7 +32,7 @@ namespace Oqtane.Security
var user = userManager.GetUser(context.Principal.UserId(), alias.SiteId); // cached
// check if user is valid, not deleted, has roles, and security stamp has not changed
if (user != null && !user.IsDeleted && user.Roles.Any() && context.Principal.SecurityStamp() == user.SecurityStamp)
if (user != null && !user.IsDeleted && !string.IsNullOrEmpty(user.Roles) && context.Principal.SecurityStamp() == user.SecurityStamp)
{
// validate sitekey in case user has changed sites in installation
if (context.Principal.SiteKey() != alias.SiteKey || !context.Principal.Roles().Any())