yesod-auth 1.6.10.5 → 1.6.11
raw patch · 5 files changed
+28/−8 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- README.md +2/−1
- Yesod/Auth.hs +1/−2
- Yesod/Auth/GoogleEmail2.hs +20/−4
- yesod-auth.cabal +1/−1
ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for yesod-auth +## 1.6.11++* Add support for aeson 2+ ## 1.6.10.5 * Fix German translations of AuthMessage [#1741](https://github.com/yesodweb/yesod/pull/1741)
README.md view
@@ -6,6 +6,7 @@ from Hackage as well. If you've written such an add-on, please notify me so that it can be added to this description. +* [yesod-auth-oauth2](https://hackage.haskell.org/package/yesod-auth-oauth2): Library to authenticate with OAuth 2.0. * [yesod-auth-account](http://hackage.haskell.org/package/yesod-auth-account): An account authentication plugin for Yesod * [yesod-auth-hashdb](http://www.stackage.org/package/yesod-auth-hashdb): The HashDB module previously packaged in yesod-auth, now with stronger, but compatible, security.-* [yesod-auth-bcrypt](https://github.com/ollieh/yesod-auth-bcrypt/): An alternative to the HashDB module.+* [yesod-auth-bcrypt](https://hackage.haskell.org/package/yesod-auth-bcrypt): An alternative to the HashDB module.
Yesod/Auth.hs view
@@ -52,7 +52,6 @@ import UnliftIO (withRunInIO, MonadUnliftIO) import Yesod.Auth.Routes-import Data.Aeson hiding (json) import Data.Text.Encoding (decodeUtf8With) import Data.Text.Encoding.Error (lenientDecode) import Data.Text (Text)@@ -452,7 +451,7 @@ <p>Not logged in. |] jsonCreds creds =- Object $ Map.fromList+ toJSON $ Map.fromList [ (T.pack "logged_in", Bool $ maybe False (const True) creds) ]
Yesod/Auth/GoogleEmail2.hs view
@@ -87,7 +87,6 @@ parseMaybe, withObject, withText) import Data.Conduit import Data.Conduit.Attoparsec (sinkParser)-import qualified Data.HashMap.Strict as M import Data.Maybe (fromMaybe) import Data.Monoid (mappend) import Data.Text (Text)@@ -103,7 +102,14 @@ import Network.HTTP.Types (renderQueryText) import System.IO.Unsafe (unsafePerformIO) +#if MIN_VERSION_aeson(2, 0, 0)+import qualified Data.Aeson.Key+import qualified Data.Aeson.KeyMap+#else+import qualified Data.HashMap.Strict as M+#endif + -- | Plugin identifier. This is used to identify the plugin used for -- authentication. The 'credsPlugin' will contain this value when this -- plugin is used for authentication.@@ -587,9 +593,19 @@ _ -> EmailType t allPersonInfo :: A.Value -> [(Text, Text)]-allPersonInfo (A.Object o) = map enc $ M.toList o- where enc (key, A.String s) = (key, s)- enc (key, v) = (key, TL.toStrict $ TL.toLazyText $ A.encodeToTextBuilder v)+allPersonInfo (A.Object o) = map enc $ mapToList o+ where+ enc (key, A.String s) = (keyToText key, s)+ enc (key, v) = (keyToText key, TL.toStrict $ TL.toLazyText $ A.encodeToTextBuilder v)++#if MIN_VERSION_aeson(2, 0, 0)+ keyToText = Data.Aeson.Key.toText+ mapToList = Data.Aeson.KeyMap.toList+#else+ keyToText = id+ mapToList = M.toList+#endif+ allPersonInfo _ = []
yesod-auth.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: yesod-auth-version: 1.6.10.5+version: 1.6.11 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin