hoauth2-providers-tutorial 0.9.0 → 0.9.1
raw patch · 2 files changed
+8/−8 lines, 2 filesdep ~containers
Dependency ranges changed: containers
Files
hoauth2-providers-tutorial.cabal view
@@ -1,9 +1,9 @@ cabal-version: 2.4 name: hoauth2-providers-tutorial-version: 0.9.0-synopsis: tutorial for hoauth2-providers module+version: 0.9.1+synopsis: Tutorial for the hoauth2-providers module description:- A tutorial that demostrates how to use hoauth2-providers package+ A tutorial that demonstrates how to use the hoauth2-providers package for OAuth2 Authorization Code flow. license: MIT@@ -18,7 +18,7 @@ build-depends: , base >=4.11 && <5 , bytestring >=0.9 && <0.13- , containers >=0.6 && <0.8+ , containers >=0.6 && <0.9 , hoauth2 >=2.9 && <2.16 , hoauth2-providers >=0.3 && <0.10 , http-conduit >=2.1 && <2.4
src/HOAuth2ProvidersTutorial.hs view
@@ -77,7 +77,7 @@ idp = Google.defaultGoogleIdp in IdpApplication {..} --- | You'll need to find out an better way to create @state@+-- | You'll need to find a better way to create @state@ -- which is recommended in <https://www.rfc-editor.org/rfc/rfc6749#section-10.12> randomStateValue :: TL.Text randomStateValue = "random-state-to-prevent-csrf"@@ -176,7 +176,7 @@ user <- case idpName of "google" -> handleGoogleCallback googleApp code "auth0" -> handleAuth0Callback auth0App code- _ -> throwE $ "unable to find idp app of: " <> idpName+ _ -> throwE $ "Unable to find IdP app for: " <> idpName liftIO $ writeIORef refUser (Just user) @@ -219,7 +219,7 @@ Either TL.Text TL.Text paramValue key params = case val of- [] -> Left ("No value found for param: " <> key)+ [] -> Left ("No value found for parameter: " <> key) (x : _) -> Right x where val = snd <$> filter (hasParam key) params@@ -233,4 +233,4 @@ either Scotty.raise pure result oauth2ErrorToText :: TokenResponseError -> TL.Text-oauth2ErrorToText e = TL.pack $ "Unable fetch access token. error detail: " ++ show e+oauth2ErrorToText e = TL.pack $ "Unable to fetch access token. Error detail: " ++ show e