diff options
Diffstat (limited to 'src/server/Model')
-rw-r--r-- | src/server/Model/SignIn.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/server/Model/SignIn.hs b/src/server/Model/SignIn.hs index c447416..0f9c6ce 100644 --- a/src/server/Model/SignIn.hs +++ b/src/server/Model/SignIn.hs @@ -1,7 +1,7 @@ module Model.SignIn ( createSignInToken , getSignInToken - , signInTokenIsUsed + , signInTokenToUsed ) where import Data.Text (Text) @@ -23,12 +23,8 @@ createSignInToken email = do getSignInToken :: Text -> Persist (Maybe (Entity SignIn)) getSignInToken token = - selectFirst - [ SignInToken ==. token - , SignInIsUsed ==. False - ] - [] + selectFirst [SignInToken ==. token] [] -signInTokenIsUsed :: SignInId -> Persist () -signInTokenIsUsed tokenId = +signInTokenToUsed :: SignInId -> Persist () +signInTokenToUsed tokenId = update tokenId [SignInIsUsed =. True] |