chore(model): rename userLastLogin->userLastAuthentication for less migration woes
This commit is contained in:
parent
41b14f1ece
commit
71e2d6827e
@ -14,8 +14,8 @@
|
||||
|
||||
User json -- Each Uni2work user has a corresponding row in this table; created upon first login.
|
||||
ident UserIdent -- Case-insensitive user-identifier
|
||||
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?
|
||||
passwordHash Text Maybe -- If specified, allows the user to login with credentials independently of external authentication
|
||||
lastAuthentication UTCTime Maybe -- When did the user last authenticate?
|
||||
surname UserSurname -- Display user names always through 'nameWidget displayName surname'
|
||||
displayName UserDisplayName
|
||||
displayEmail UserEmail
|
||||
|
||||
@ -117,7 +117,7 @@ authenticate creds@Creds{..} = liftHandler . runDB . withReaderT projectBackend
|
||||
-> return ()
|
||||
case res of
|
||||
Authenticated uid
|
||||
| not isDummy -> res <$ update uid [ UserLastLogin =. Just now ]
|
||||
| not isDummy -> res <$ update uid [ UserLastAuthentication =. Just now ]
|
||||
_other -> return res
|
||||
|
||||
$logDebugS "Auth" $ tshow Creds{..}
|
||||
@ -389,7 +389,7 @@ decodeUser now UserDefaultConf{..} upsertData = do
|
||||
, userPinPassword = Nothing -- must be derived via AVS
|
||||
, userPrefersPostal = userDefaultPrefersPostal
|
||||
, userPasswordHash = Nothing
|
||||
, userLastLogin = Nothing
|
||||
, userLastAuthentication = Nothing
|
||||
, ..
|
||||
}
|
||||
userUpdate =
|
||||
|
||||
@ -910,7 +910,7 @@ assimilateUser newUserId oldUserId = mapReaderT execWriterT $ do
|
||||
|
||||
update newUserId $ catMaybes -- NOTE: persist does shortcircuit null updates as expected
|
||||
[ mergeMaybe UserPasswordHash
|
||||
, mergeBy (>) UserLastLogin
|
||||
, mergeBy (>) UserLastAuthentication
|
||||
, mergeBy (<) UserCreated
|
||||
, toMaybe (not (validEmail' (newUser ^. _userEmail )) && validEmail' (oldUser ^. _userEmail))
|
||||
(UserEmail =. oldUser ^. _userEmail)
|
||||
|
||||
@ -44,7 +44,7 @@ addNewUser AddUserData{..} = do
|
||||
let
|
||||
newUser = User
|
||||
{ userIdent = audIdent
|
||||
, userLastLogin = Nothing
|
||||
, userLastAuthentication = Nothing
|
||||
, userPasswordHash = Nothing
|
||||
, userMaxFavourites = userDefaultMaxFavourites
|
||||
, userMaxFavouriteTerms = userDefaultMaxFavouriteTerms
|
||||
|
||||
Reference in New Issue
Block a user