Skip to content

Commit

Permalink
Merge pull request #4622 from sbwalker/dev
Browse files Browse the repository at this point in the history
allow external login to support SecurityStamp
  • Loading branch information
sbwalker authored Sep 17, 2024
2 parents d4d4034 + 3351732 commit 6f5da1c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Net;
using System.Text.Json.Nodes;
using System.Globalization;
using System.Net.WebSockets;

namespace Oqtane.Extensions
{
Expand Down Expand Up @@ -366,6 +365,7 @@ private static async Task<ClaimsIdentity> ValidateUser(string id, string name, s
{
user = _users.GetUser(identityuser.UserName);
user.SiteId = alias.SiteId;
user.SecurityStamp = identityuser.SecurityStamp;
}
else
{
Expand Down Expand Up @@ -431,14 +431,17 @@ private static async Task<ClaimsIdentity> ValidateUser(string id, string name, s
var result = await _identityUserManager.CreateAsync(identityuser, password);
if (result.Succeeded)
{
identityuser = await _identityUserManager.FindByNameAsync(username);

user = new User
{
SiteId = alias.SiteId,
Username = username,
DisplayName = displayname,
Email = emailaddress,
LastLoginOn = null,
LastIPAddress = ""
LastIPAddress = "",
SecurityStamp = identityuser.SecurityStamp
};
user = _users.AddUser(user);

Expand Down

0 comments on commit 6f5da1c

Please sign in to comment.