Skip to content

Instantly share code, notes, and snippets.

@skeet70
Created May 15, 2018 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skeet70/dc995d5bdd9770c4e17f69de2c1c7abf to your computer and use it in GitHub Desktop.
Save skeet70/dc995d5bdd9770c4e17f69de2c1c7abf to your computer and use it in GitHub Desktop.
authHandler :: Manager -> AuthHandler Request User
authHandler manager = mkAuthHandler handler
where
throw401 msg =
throwError $ err401 {errBody = "Unauthorized:" <> msg <> " ."}
handler req =
either
throw401
(getRevvUser manager)
(lookupAccessToken $ queryString req)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment