Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Server.Authentication.Utils
Synopsis
- getCallbackUri :: Text -> ServerPart URI
- saveReferer :: Text -> ServerPart ()
- redirectToCurrentRefererIfAllowed :: ServerPart Response
- redirectToSavedRefererIfAllowed :: Text -> ServerPart Response
- redirectToBodyRefererIfAllowed :: ServerPart Response
- presentMessageAndRedirectToTargetUrl :: Text -> Text -> ServerPart Response
- presentMessageAndRedirectToBodyRefererIfAllowed :: Text -> ServerPart Response
- presentMessageAndRedirectToCookieRefererIfAllowed :: Text -> Text -> ServerPart Response
- isAllowedReferer :: Text -> Bool
- retrieveRequestHeaderRefererIfAllowed :: ServerPart (Maybe Text)
- retrieveBodyRefererIfAllowed :: ServerPart (Maybe Text)
- retrieveCookieRefererIfAllowed :: Text -> ServerPart (Maybe Text)
Documentation
getCallbackUri :: Text -> ServerPart URI Source #
Retrieves the appropriate callback URI based on the Host header.
saveReferer :: Text -> ServerPart () Source #
Saves the referer from the Referer request header to the specified cookie.
redirectToCurrentRefererIfAllowed :: ServerPart Response Source #
Redirects to the current referer, if allowed; otherwise, redirects to homepage. TODO: rename function to "redirectToRequestHeaderRefererIfAllowed"
redirectToSavedRefererIfAllowed :: Text -> ServerPart Response Source #
Redirects to the referer from the specified cookie, if allowed; otherwise, redirects to homepage.
redirectToBodyRefererIfAllowed :: ServerPart Response Source #
Redirects to the referer from the "referer" parameter in the request body, if allowed; otherwise, redirects to homepage.
presentMessageAndRedirectToTargetUrl :: Text -> Text -> ServerPart Response Source #
Display a custom message and then redirects to the target url.
presentMessageAndRedirectToBodyRefererIfAllowed :: Text -> ServerPart Response Source #
Display a custom message and then redirects to the referer found in the "referer" parameter in the request body, if allowed; otherwise, redirects to homepage.
presentMessageAndRedirectToCookieRefererIfAllowed :: Text -> Text -> ServerPart Response Source #
Display a custom message and then redirects to the referer found in the specified cookie, if allowed; otherwise, redirects to homepage.
isAllowedReferer :: Text -> Bool Source #
Checks whether a given referer is allowed.
retrieveRequestHeaderRefererIfAllowed :: ServerPart (Maybe Text) Source #