diff options
Diffstat (limited to 'src/server/Controller/SignIn.hs')
-rw-r--r-- | src/server/Controller/SignIn.hs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/Controller/SignIn.hs b/src/server/Controller/SignIn.hs index f6804e1..0fbe7c5 100644 --- a/src/server/Controller/SignIn.hs +++ b/src/server/Controller/SignIn.hs @@ -17,7 +17,8 @@ import qualified Data.Text as T import qualified Data.Text.Lazy as TL import qualified Data.Text.Encoding as TE -import Conf +import Conf (Conf) +import qualified Conf import SendMail @@ -38,7 +39,12 @@ signIn conf login = case maybeUser of Just user -> do token <- liftIO . runDb $ createSignInToken login - let url = T.concat ["http://", hostname conf, "?signInToken=", token] + let url = T.concat [ + if Conf.https conf then "https://" else "http://", + Conf.hostname conf, + "?signInToken=", + token + ] maybeSentMail <- liftIO . sendMail $ SignIn.getMail conf (entityVal user) url [login] case maybeSentMail of Right _ -> |