chore(model): rename userLastLogin->userLastAuthentication for less migration woes

This commit is contained in:
Sarah Vaupel 2024-02-21 02:06:00 +01:00
parent 41b14f1ece
commit 71e2d6827e
4 changed files with 6 additions and 6 deletions

View File

@ -14,8 +14,8 @@
User json -- Each Uni2work user has a corresponding row in this table; created upon first login. User json -- Each Uni2work user has a corresponding row in this table; created upon first login.
ident UserIdent -- Case-insensitive user-identifier ident UserIdent -- Case-insensitive user-identifier
passwordHash Text Maybe -- If specified, allows the user to login with credentials independently of external authentication passwordHash Text Maybe -- If specified, allows the user to login with credentials independently of external authentication
lastLogin UTCTime Maybe -- When did the user last authenticate? lastAuthentication UTCTime Maybe -- When did the user last authenticate?
surname UserSurname -- Display user names always through 'nameWidget displayName surname' surname UserSurname -- Display user names always through 'nameWidget displayName surname'
displayName UserDisplayName displayName UserDisplayName
displayEmail UserEmail displayEmail UserEmail

View File

@ -117,7 +117,7 @@ authenticate creds@Creds{..} = liftHandler . runDB . withReaderT projectBackend
-> return () -> return ()
case res of case res of
Authenticated uid Authenticated uid
| not isDummy -> res <$ update uid [ UserLastLogin =. Just now ] | not isDummy -> res <$ update uid [ UserLastAuthentication =. Just now ]
_other -> return res _other -> return res
$logDebugS "Auth" $ tshow Creds{..} $logDebugS "Auth" $ tshow Creds{..}
@ -389,7 +389,7 @@ decodeUser now UserDefaultConf{..} upsertData = do
, userPinPassword = Nothing -- must be derived via AVS , userPinPassword = Nothing -- must be derived via AVS
, userPrefersPostal = userDefaultPrefersPostal , userPrefersPostal = userDefaultPrefersPostal
, userPasswordHash = Nothing , userPasswordHash = Nothing
, userLastLogin = Nothing , userLastAuthentication = Nothing
, .. , ..
} }
userUpdate = userUpdate =

View File

@ -910,7 +910,7 @@ assimilateUser newUserId oldUserId = mapReaderT execWriterT $ do
update newUserId $ catMaybes -- NOTE: persist does shortcircuit null updates as expected update newUserId $ catMaybes -- NOTE: persist does shortcircuit null updates as expected
[ mergeMaybe UserPasswordHash [ mergeMaybe UserPasswordHash
, mergeBy (>) UserLastLogin , mergeBy (>) UserLastAuthentication
, mergeBy (<) UserCreated , mergeBy (<) UserCreated
, toMaybe (not (validEmail' (newUser ^. _userEmail )) && validEmail' (oldUser ^. _userEmail)) , toMaybe (not (validEmail' (newUser ^. _userEmail )) && validEmail' (oldUser ^. _userEmail))
(UserEmail =. oldUser ^. _userEmail) (UserEmail =. oldUser ^. _userEmail)

View File

@ -44,7 +44,7 @@ addNewUser AddUserData{..} = do
let let
newUser = User newUser = User
{ userIdent = audIdent { userIdent = audIdent
, userLastLogin = Nothing , userLastAuthentication = Nothing
, userPasswordHash = Nothing , userPasswordHash = Nothing
, userMaxFavourites = userDefaultMaxFavourites , userMaxFavourites = userDefaultMaxFavourites
, userMaxFavouriteTerms = userDefaultMaxFavouriteTerms , userMaxFavouriteTerms = userDefaultMaxFavouriteTerms