Merge pull request #980 from rzetterberg/master
Adds export of email verify route
This commit is contained in:
commit
9db6ef3e69
@ -30,6 +30,7 @@ module Yesod.Auth.Email
|
|||||||
, registerR
|
, registerR
|
||||||
, forgotPasswordR
|
, forgotPasswordR
|
||||||
, setpassR
|
, setpassR
|
||||||
|
, verifyR
|
||||||
, isValidPass
|
, isValidPass
|
||||||
-- * Types
|
-- * Types
|
||||||
, Email
|
, Email
|
||||||
@ -74,8 +75,8 @@ registerR = PluginR "email" ["register"]
|
|||||||
forgotPasswordR = PluginR "email" ["forgot-password"]
|
forgotPasswordR = PluginR "email" ["forgot-password"]
|
||||||
setpassR = PluginR "email" ["set-password"]
|
setpassR = PluginR "email" ["set-password"]
|
||||||
|
|
||||||
verify :: Text -> Text -> AuthRoute -- FIXME
|
verifyR :: Text -> Text -> AuthRoute -- FIXME
|
||||||
verify eid verkey = PluginR "email" ["verify", eid, verkey]
|
verifyR eid verkey = PluginR "email" ["verify", eid, verkey]
|
||||||
|
|
||||||
type Email = Text
|
type Email = Text
|
||||||
type VerKey = Text
|
type VerKey = Text
|
||||||
@ -345,7 +346,7 @@ registerHelper allowUsername dest = do
|
|||||||
Nothing -> loginErrorMessageI dest (Msg.IdentifierNotFound identifier)
|
Nothing -> loginErrorMessageI dest (Msg.IdentifierNotFound identifier)
|
||||||
Just (lid, verKey, email) -> do
|
Just (lid, verKey, email) -> do
|
||||||
render <- getUrlRender
|
render <- getUrlRender
|
||||||
let verUrl = render $ verify (toPathPiece lid) verKey
|
let verUrl = render $ verifyR (toPathPiece lid) verKey
|
||||||
lift $ sendVerifyEmail email verKey verUrl
|
lift $ sendVerifyEmail email verKey verUrl
|
||||||
lift $ confirmationEmailSentResponse identifier
|
lift $ confirmationEmailSentResponse identifier
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user