Changed some types
This commit is contained in:
parent
0c9e2f94c0
commit
7d1b88f55a
@ -14,6 +14,7 @@ module Yesod.Dispatch
|
|||||||
, basicHandler
|
, basicHandler
|
||||||
-- * Utilities
|
-- * Utilities
|
||||||
, fullRender
|
, fullRender
|
||||||
|
, quasiRender
|
||||||
#if TEST
|
#if TEST
|
||||||
, testSuite
|
, testSuite
|
||||||
#endif
|
#endif
|
||||||
@ -167,7 +168,7 @@ toWaiApp' y segments env = do
|
|||||||
pathSegments = filter (not . null) segments
|
pathSegments = filter (not . null) segments
|
||||||
eurl = quasiParse site pathSegments
|
eurl = quasiParse site pathSegments
|
||||||
render u = fromMaybe
|
render u = fromMaybe
|
||||||
(fullRender (approot y) site u)
|
(fullRender (approot y) (quasiRender site) u)
|
||||||
(urlRenderOverride y u)
|
(urlRenderOverride y u)
|
||||||
rr <- parseWaiRequest env session'
|
rr <- parseWaiRequest env session'
|
||||||
onRequest y rr
|
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,
|
-- For example, if you want to generate an e-mail which links to your site,
|
||||||
-- this is the function you would want to use.
|
-- this is the function you would want to use.
|
||||||
fullRender :: String -- ^ approot, no trailing slash
|
fullRender :: String -- ^ approot, no trailing slash
|
||||||
-> QuasiSite YesodApp arg arg
|
-> (url -> [String])
|
||||||
-> Routes arg
|
-> url
|
||||||
-> String
|
-> String
|
||||||
fullRender ar site route =
|
fullRender ar render route =
|
||||||
ar ++ '/' : encodePathInfo (fixSegs $ quasiRender site route)
|
ar ++ '/' : encodePathInfo (fixSegs $ render route)
|
||||||
|
|
||||||
httpAccept :: W.Request -> [ContentType]
|
httpAccept :: W.Request -> [ContentType]
|
||||||
httpAccept = map (contentTypeFromString . B.unpack)
|
httpAccept = map (contentTypeFromString . B.unpack)
|
||||||
|
|||||||
@ -27,6 +27,7 @@ module Yesod.Helpers.Auth
|
|||||||
-- * Settings
|
-- * Settings
|
||||||
, YesodAuth (..)
|
, YesodAuth (..)
|
||||||
, Creds (..)
|
, Creds (..)
|
||||||
|
, EmailCreds (..)
|
||||||
, AuthType (..)
|
, AuthType (..)
|
||||||
, AuthEmailSettings (..)
|
, AuthEmailSettings (..)
|
||||||
, inMemoryEmailSettings
|
, inMemoryEmailSettings
|
||||||
@ -127,7 +128,7 @@ setCreds creds extra = do
|
|||||||
onLogin creds extra
|
onLogin creds extra
|
||||||
|
|
||||||
-- | Retrieves user credentials, if user is authenticated.
|
-- | Retrieves user credentials, if user is authenticated.
|
||||||
maybeCreds :: GHandler sub master (Maybe Creds)
|
maybeCreds :: RequestReader r => r (Maybe Creds)
|
||||||
maybeCreds = do
|
maybeCreds = do
|
||||||
mcs <- lookupSession credsKey
|
mcs <- lookupSession credsKey
|
||||||
return $ mcs >>= readMay
|
return $ mcs >>= readMay
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user