yesod-auth-oauth 0.1 → 0.2
raw patch · 2 files changed
+8/−11 lines, 2 files
Files
- Yesod/Helpers/Auth/OAuth.hs +7/−10
- yesod-auth-oauth.cabal +1/−1
Yesod/Helpers/Auth/OAuth.hs view
@@ -3,6 +3,7 @@ ( authOAuth , oauthUrl , authTwitter+ , twitterUrl ) where import Yesod import Yesod.Helpers.Auth@@ -12,8 +13,8 @@ import Network.OAuth.Http.CurlHttpClient import Data.Maybe -oauthUrl :: AuthRoute-oauthUrl = PluginR "oauth" ["forward"]+oauthUrl :: String -> AuthRoute+oauthUrl name = PluginR name ["forward"] authOAuth :: YesodAuth m => String -- ^ Service Name@@ -56,14 +57,7 @@ dispatch _ _ = notFound login tm = do render <- liftHandler getUrlRender- let app = Application key sec (URL $ render $ tm url)- tok <- runOAuthM (fromApplication app) $ do- signRq2 HMACSHA1 Nothing (fromJust . parseURL $ reqUrl) >>= oauthRequest CurlClient- let oaUrl = concat- [authUrl- , "?oauth_token="- , findWithDefault ("oauth_token", "ERR") $ oauthParams tok- ]+ let oaUrl = render $ tm $ oauthUrl name addHtml #if GHC7 [hamlet|@@ -82,3 +76,6 @@ "http://twitter.com/oauth/request_token" "http://twitter.com/oauth/access_token" "http://twitter.com/oauth/authorize"++twitterUrl :: AuthRoute+twitterUrl = oauthUrl "twitter"
yesod-auth-oauth.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.1+Version: 0.2 -- A short (one-line) description of the package. Synopsis: OAuth wrapper for yesod-auth