From 400f323db4aa004be844be6df08a7c3391aba478 Mon Sep 17 00:00:00 2001 From: Mole Date: Wed, 20 Apr 2022 14:21:36 +0200 Subject: [PATCH] Do full save on first member login (#12216) --- .../Security/Providers/UmbracoMembershipProvider.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs index 0e2fd0110620..9e2346c8b9aa 100644 --- a/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs +++ b/src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs @@ -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("Login attempt succeeded for username {Username} from IP address {IpAddress}", username, GetCurrentRequestIpAddress());