Skip to content

Commit

Permalink
Do full save on first member login (#12216)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolajlauridsen authored Apr 20, 2022
1 parent 76ecb29 commit 400f323
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,13 @@ internal virtual ValidateUserResult PerformValidateUser(string username, string
requiresFullSave = true;
}

// If the last login date is default prior to setting it, it means that this value has never been set
// and therefore there's no property data created for it yet, which means that we can't just update that property
// and need to do a full save.
if (member.LastLoginDate == default)
{
requiresFullSave = true;
}
member.LastLoginDate = DateTime.Now;

Current.Logger.Info<UmbracoMembershipProviderBase, string, string>("Login attempt succeeded for username {Username} from IP address {IpAddress}", username, GetCurrentRequestIpAddress());
Expand Down

0 comments on commit 400f323

Please sign in to comment.