diff --git a/yesod-auth/Yesod/Auth/GoogleEmail.hs b/yesod-auth/Yesod/Auth/GoogleEmail.hs index 74ce9d66..6bc1578e 100644 --- a/yesod-auth/Yesod/Auth/GoogleEmail.hs +++ b/yesod-auth/Yesod/Auth/GoogleEmail.hs @@ -31,17 +31,20 @@ import qualified Yesod.Auth.Message as Msg import qualified Data.Text as T import Control.Exception.Lifted (try, SomeException) +pid :: Text +pid = "googleemail" + forwardUrl :: AuthRoute -forwardUrl = PluginR "googleemail" ["forward"] +forwardUrl = PluginR pid ["forward"] googleIdent :: Text googleIdent = "https://www.google.com/accounts/o8/id" authGoogleEmail :: YesodAuth m => AuthPlugin m authGoogleEmail = - AuthPlugin "googleemail" dispatch login + AuthPlugin pid dispatch login where - complete = PluginR "googleemail" ["complete"] + complete = PluginR pid ["complete"] login tm = [whamlet|_{Msg.LoginGoogle}|] dispatch "GET" ["forward"] = do @@ -86,7 +89,7 @@ completeHelper gets' = do let OpenId.Identifier ident = OpenId.oirOpLocal oir memail <- lookupGetParam "openid.ext1.value.email" case (memail, "https://www.google.com/accounts/o8/id" `T.isPrefixOf` ident) of - (Just email, True) -> setCreds True $ Creds "openid" email [] + (Just email, True) -> setCreds True $ Creds pid email [] (_, False) -> do setMessage "Only Google login is supported" redirect $ toMaster LoginR