From faf60f623ef21912b600c043444f6b03197f086b Mon Sep 17 00:00:00 2001 From: Michael Steele Date: Thu, 24 May 2012 15:35:57 -0700 Subject: [PATCH] yesod-auth: change returned Creds identifier to "googleemail". --- yesod-auth/Yesod/Auth/GoogleEmail.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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