packages feed

yesod-auth-oauth 0.8.0 → 0.8.1

raw patch · 2 files changed

+23/−12 lines, 2 filesdep ~authenticate-oauthPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: authenticate-oauth

API changes (from Hackage documentation)

Files

Yesod/Auth/OAuth.hs view
@@ -48,19 +48,29 @@         setSession oauthSessionName $ lookupTokenSecret tok         redirect $ authorizeUrl oauth' tok     dispatch "GET" [] = do-        (verifier, oaTok) <- runInputGet $ (,)-            <$> ireq textField "oauth_verifier"-            <*> ireq textField "oauth_token"-        tokSec <- fromJust <$> lookupSession oauthSessionName-        deleteSession oauthSessionName-        let reqTok = Credential [ ("oauth_verifier", encodeUtf8 verifier)+      reqTok <-+        if oauthVersion oauth == OAuth10+          then do+            oaTok  <- runInputGet $ ireq textField "oauth_token"+            tokSec <- fromJust <$> lookupSession oauthSessionName+            deleteSession oauthSessionName+            return $ Credential [ ("oauth_token", encodeUtf8 oaTok)+                                , ("oauth_token_secret", encodeUtf8 tokSec)+                                ]+          else do+            (verifier, oaTok) <-+                runInputGet $ (,) <$> ireq textField "oauth_verifier"+                                  <*> ireq textField "oauth_token"+            tokSec <- fromJust <$> lookupSession oauthSessionName+            deleteSession oauthSessionName+            return $ Credential [ ("oauth_verifier", encodeUtf8 verifier)                                 , ("oauth_token", encodeUtf8 oaTok)                                 , ("oauth_token_secret", encodeUtf8 tokSec)                                 ]-        master <- getYesod-        accTok <- lift $ getAccessToken oauth reqTok (authHttpManager master)-        creds  <- resourceLiftBase $ mkCreds accTok-        setCreds True creds+      master <- getYesod+      accTok <- lift $ getAccessToken oauth reqTok (authHttpManager master)+      creds  <- resourceLiftBase $ mkCreds accTok+      setCreds True creds     dispatch _ _ = notFound     login tm = do         render <- lift getUrlRender@@ -80,6 +90,7 @@                           , oauthSignatureMethod = HMACSHA1                           , oauthConsumerKey     = key                           , oauthConsumerSecret  = secret+                          , oauthVersion         = OAuth10a                           })                 extractCreds   where
yesod-auth-oauth.cabal view
@@ -1,5 +1,5 @@ name:            yesod-auth-oauth-version:         0.8.0+version:         0.8.1 license:         BSD3 license-file:    LICENSE author:          Hiromi Ishii@@ -21,7 +21,7 @@         cpp-options:     -DGHC7     else         build-depends:   base                >= 4        && < 4.3-    build-depends:   authenticate-oauth      >= 1.0       && < 1.1+    build-depends:   authenticate-oauth      >= 1.1       && < 1.2                    , bytestring              >= 0.9.1.4   && < 0.10                    , yesod-core              >= 0.10      && < 0.11                    , yesod-auth              >= 0.8       && < 0.9