lojbanios-0.1.0.0: Lojban teaching platform
Safe HaskellSafe-Inferred
LanguageHaskell2010

Server.Authentication.Utils

Synopsis

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 #

Retrieves the referer found in the Referer request header, if allowed; otherwise, returns Nothing.

retrieveBodyRefererIfAllowed :: ServerPart (Maybe Text) Source #

Retrieves the referer found in the "referer" parameter in the request body, if allowed; otherwise, returns Nothing.

retrieveCookieRefererIfAllowed :: Text -> ServerPart (Maybe Text) Source #

Retrieves the referer found in the specified cookie, if allowed; otherwise, returns Nothing.