摘要:
main = defaultMain[ bench "bigTable html" $ nf bigTableHtml bigTableData, bench "bigTable hamlet" $ nf bigTableHamlet bigTableData, bench "bigTable widget" $ nf bigTableWidget bigTableData, bench "bigTable blaze" $ nf bigTableBlaze bigTableData]whererows :: In 阅读全文
摘要:
getAuth :: a -> AuthgetAuth = const Auth-- | User credentialsdata Creds m = Creds{ credsPlugin :: Text -- ^ How the user was authenticated, credsIdent :: Text -- ^ Identifier. Exact meaning depends on plugin., credsExtra :: [(Text, Text)]}class (Yesod m, PathPiece (AuthId m), RenderMessage m Form 阅读全文
摘要:
mkPersist [$persist|Emailemail String Eqstatus Bool updateverkey String null updatepassword String null updateUniqueEmail email|]data A2 = A2 { connPool :: ConnectionPool }mkYesod "A2" [$parseRoutes|/auth AuthR Auth getAuth|]instance Yesod A2 where approot _ = "http://localhost:3000&q 阅读全文
摘要:
getRootR :: Handler ()getRootR = redirect RedirectTemporary $ AuthR LoginRgetAfterLoginR :: Handler RepHtmlgetAfterLoginR = domauth <- maybeAuthIddefaultLayout $ addHamlet [hamlet|<p>Auth: #{show mauth}|]instance Yesod BID whereapproot _ = "http://localhost:3000"instance YesodAuth 阅读全文
摘要:
getRootR :: Handler RepHtmlgetRootR = getAfterLoginRgetAfterLoginR :: Handler RepHtmlgetAfterLoginR = domauth <- maybeAuthIddefaultLayout $ addHamlet [hamlet|<p>Auth: #{show mauth}$maybe _ <- mauth<p><a href=@{AuthR LogoutR}>Logout$nothing<p><a href=@{AuthR LoginR}&g 阅读全文
摘要:
oauthUrl :: Text -> AuthRouteoauthUrl name = PluginR name ["forward"]authOAuth :: YesodAuth m=> OAuth -- ^ 'OAuth' data-type for signing.-> (Credential -> IO (Creds m)) -- ^ How to extract ident. -> AuthPlugin mauthOAuth oauth mkCreds = AuthPlugin name dispatch login 阅读全文