Changed some types

This commit is contained in:
Michael Snoyman 2010-05-16 15:34:54 +03:00
parent 0c9e2f94c0
commit 7d1b88f55a
2 changed files with 8 additions and 6 deletions

View File

@ -14,6 +14,7 @@ module Yesod.Dispatch
, basicHandler
-- * Utilities
, fullRender
, quasiRender
#if TEST
, testSuite
#endif
@ -167,7 +168,7 @@ toWaiApp' y segments env = do
pathSegments = filter (not . null) segments
eurl = quasiParse site pathSegments
render u = fromMaybe
(fullRender (approot y) site u)
(fullRender (approot y) (quasiRender site) u)
(urlRenderOverride y u)
rr <- parseWaiRequest env session'
onRequest y rr
@ -206,11 +207,11 @@ toWaiApp' y segments env = do
-- For example, if you want to generate an e-mail which links to your site,
-- this is the function you would want to use.
fullRender :: String -- ^ approot, no trailing slash
-> QuasiSite YesodApp arg arg
-> Routes arg
-> (url -> [String])
-> url
-> String
fullRender ar site route =
ar ++ '/' : encodePathInfo (fixSegs $ quasiRender site route)
fullRender ar render route =
ar ++ '/' : encodePathInfo (fixSegs $ render route)
httpAccept :: W.Request -> [ContentType]
httpAccept = map (contentTypeFromString . B.unpack)

View File

@ -27,6 +27,7 @@ module Yesod.Helpers.Auth
-- * Settings
, YesodAuth (..)
, Creds (..)
, EmailCreds (..)
, AuthType (..)
, AuthEmailSettings (..)
, inMemoryEmailSettings
@ -127,7 +128,7 @@ setCreds creds extra = do
onLogin creds extra
-- | Retrieves user credentials, if user is authenticated.
maybeCreds :: GHandler sub master (Maybe Creds)
maybeCreds :: RequestReader r => r (Maybe Creds)
maybeCreds = do
mcs <- lookupSession credsKey
return $ mcs >>= readMay