yesod-auth-oauth 1.4.0.2 → 1.4.1
raw patch · 3 files changed
+32/−7 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Yesod.Auth.OAuth: instance Exception YesodOAuthException
- Yesod.Auth.OAuth: instance Show YesodOAuthException
+ Yesod.Auth.OAuth: authTwitterUsingUserId :: YesodAuth m => ByteString -> ByteString -> AuthPlugin m
+ Yesod.Auth.OAuth: instance GHC.Exception.Exception Yesod.Auth.OAuth.YesodOAuthException
+ Yesod.Auth.OAuth: instance GHC.Show.Show Yesod.Auth.OAuth.YesodOAuthException
Files
- ChangeLog.md +4/−0
- Yesod/Auth/OAuth.hs +27/−6
- yesod-auth-oauth.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.4.1++* change OAuth Twitter ID, screen_name → user_id [#1168](https://github.com/yesodweb/yesod/pull/1168)+ ## 1.4.0.2 * Compile with GHC 7.10
Yesod/Auth/OAuth.hs view
@@ -4,6 +4,7 @@ ( authOAuth , oauthUrl , authTwitter+ , authTwitterUsingUserId , twitterUrl , authTumblr , tumblrUrl@@ -89,11 +90,12 @@ Just crId -> return $ Creds name crId $ map (bsToText *** bsToText) dic Nothing -> throwIO $ CredentialError ("key not found: " ++ idName) (Credential dic) -authTwitter :: YesodAuth m- => ByteString -- ^ Consumer Key- -> ByteString -- ^ Consumer Secret- -> AuthPlugin m-authTwitter key secret = authOAuth+authTwitter' :: YesodAuth m+ => ByteString -- ^ Consumer Key+ -> ByteString -- ^ Consumer Secret+ -> String+ -> AuthPlugin m+authTwitter' key secret idName = authOAuth (newOAuth { oauthServerName = "twitter" , oauthRequestUri = "https://api.twitter.com/oauth/request_token" , oauthAccessTokenUri = "https://api.twitter.com/oauth/access_token"@@ -103,7 +105,26 @@ , oauthConsumerSecret = secret , oauthVersion = OAuth10a })- (mkExtractCreds "twitter" "screen_name")+ (mkExtractCreds "twitter" idName)++-- | This plugin uses Twitter's /screen_name/ as ID, which shouldn't be used for authentication because it is mutable.+authTwitter :: YesodAuth m+ => ByteString -- ^ Consumer Key+ -> ByteString -- ^ Consumer Secret+ -> AuthPlugin m+authTwitter key secret = authTwitter' key secret "screen_name"+{-# DEPRECATED authTwitter "Use authTwitterUsingUserID instead" #-}++-- | Twitter plugin which uses Twitter's /user_id/ as ID.+--+-- For more information, see: https://github.com/yesodweb/yesod/pull/1168+--+-- @since 1.4.1+authTwitterUsingUserId :: YesodAuth m+ => ByteString -- ^ Consumer Key+ -> ByteString -- ^ Consumer Secret+ -> AuthPlugin m+authTwitterUsingUserId key secret = authTwitter' key secret "user_id" twitterUrl :: AuthRoute twitterUrl = oauthUrl "twitter"
yesod-auth-oauth.cabal view
@@ -1,5 +1,5 @@ name: yesod-auth-oauth-version: 1.4.0.2+version: 1.4.1 license: BSD3 license-file: LICENSE author: Hiromi Ishii