diff options
Diffstat (limited to 'src/server/Controller/SignIn.hs')
-rw-r--r-- | src/server/Controller/SignIn.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/Controller/SignIn.hs b/src/server/Controller/SignIn.hs index 4f41c6e..955ad35 100644 --- a/src/server/Controller/SignIn.hs +++ b/src/server/Controller/SignIn.hs @@ -1,8 +1,8 @@ {-# LANGUAGE OverloadedStrings #-} module Controller.SignIn - ( signInAction - , validateSignInAction + ( signIn + , validateSignIn ) where import Web.Scotty @@ -38,8 +38,8 @@ import Json (jsonObject) import qualified View.Mail.SignIn as SignIn -signInAction :: Config -> Text -> ActionM () -signInAction config login = +signIn :: Config -> Text -> ActionM () +signIn config login = if isValid (TE.encodeUtf8 login) then do maybeUser <- liftIO . runDb $ getUser login @@ -63,8 +63,8 @@ errorResponse msg = do status badRequest400 jsonObject [("error", Json.String msg)] -validateSignInAction :: Config -> Text -> ActionM () -validateSignInAction config token = do +validateSignIn :: Config -> Text -> ActionM () +validateSignIn config token = do maybeSignIn <- liftIO . runDb $ getSignInToken token now <- liftIO getCurrentTime case maybeSignIn of |