Merge pull request #2195 from sbwalker/dev

fix #2192 - Adding a new site fails
This commit is contained in:
Shaun Walker 2022-05-12 20:42:20 -04:00 committed by GitHub
commit 105afdfefc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 125 additions and 124 deletions

View File

@ -307,6 +307,7 @@ else
user.SiteId = PageState.Site.SiteId;
user.Username = _hostusername;
user.Password = _hostpassword;
user.LastIPAddress = PageState.RemoteIPAddress;
user = await UserService.LoginUserAsync(user);
if (user.IsAuthenticated)
{

View File

@ -327,7 +327,7 @@ namespace Oqtane.Controllers
var result = await _identitySignInManager.CheckPasswordSignInAsync(identityuser, user.Password, true);
if (result.Succeeded)
{
var LastIPAddress = user.LastIPAddress;
var LastIPAddress = user.LastIPAddress ?? "";
user = _users.GetUser(user.Username);
if (user.TwoFactorRequired)