Switch to BrowserId/GoogleEmail for scaffolded site

This commit is contained in:
Michael Snoyman 2012-01-02 21:03:13 +02:00
parent 16da67f87f
commit 13e1179409
2 changed files with 4 additions and 3 deletions

View File

@ -41,7 +41,7 @@ authGoogleEmail =
[whamlet| [whamlet|
<form method=get action=@{tm forwardUrl}> <form method=get action=@{tm forwardUrl}>
<input type=hidden name=openid_identifier value=https://www.google.com/accounts/o8/id> <input type=hidden name=openid_identifier value=https://www.google.com/accounts/o8/id>
<input type=submit value=_{Msg.LoginTitle}> <input type=submit value=_{Msg.LoginGoogle}>
|] |]
dispatch "GET" ["forward"] = do dispatch "GET" ["forward"] = do
roid <- runInputGet $ iopt textField name roid <- runInputGet $ iopt textField name

View File

@ -20,7 +20,8 @@ import Yesod
import Yesod.Static (Static, base64md5, StaticRoute(..)) import Yesod.Static (Static, base64md5, StaticRoute(..))
import Settings.StaticFiles import Settings.StaticFiles
import Yesod.Auth import Yesod.Auth
import Yesod.Auth.OpenId import Yesod.Auth.BrowserId
import Yesod.Auth.GoogleEmail
import Yesod.Default.Config import Yesod.Default.Config
import Yesod.Default.Util (addStaticContentExternal) import Yesod.Default.Util (addStaticContentExternal)
import Yesod.Logger (Logger, logMsg, formatLogText) import Yesod.Logger (Logger, logMsg, formatLogText)
@ -144,7 +145,7 @@ instance YesodAuth ~sitearg~ where
fmap Just $ insert $ User (credsIdent creds) Nothing fmap Just $ insert $ User (credsIdent creds) Nothing
-- You can add other plugins like BrowserID, email or OAuth here -- You can add other plugins like BrowserID, email or OAuth here
authPlugins = [authOpenId] authPlugins = [authBrowserId, authGoogleEmail]
-- Sends off your mail. Requires sendmail in production! -- Sends off your mail. Requires sendmail in production!
deliver :: ~sitearg~ -> L.ByteString -> IO () deliver :: ~sitearg~ -> L.ByteString -> IO ()