git.iko.soy/typeable/servant
on master help sign in
fixing servant-auth (aeson 2.0 bump)
commitefffc70919a1f8bdc9624640b9d08190ed506c7f authorakhesacaro <caroline.gaudreau@gmail.com> dateSun 14 Nov 2021, 14:33 (5 years ago) parent8af80d3
2 files changed+2−3
servant-auth/servant-auth/servant-auth.cabal−1 servant-auth/servant-auth/src/Servant/Auth/JWT.hs+2−2
servant-auth/servant-auth/servant-auth.cabal−1
@@ -40,7 +40,6 @@ library
4040 , lens >= 4.16.1 && < 5.1
4141 , servant >= 0.15 && < 0.19
4242 , text >= 1.2.3.0 && < 1.3
43− , unordered-containers >= 0.2.9.0 && < 0.3
4443 exposed-modules:
4544 Servant.Auth
4645 Servant.Auth.JWT
servant-auth/servant-auth/src/Servant/Auth/JWT.hs+2−2
@@ -4,7 +4,7 @@ import Control.Lens ((^.))
44import qualified Crypto.JWT as Jose
55import Data.Aeson (FromJSON, Result (..), ToJSON, fromJSON,
66 toJSON)
7−import qualified Data.HashMap.Strict as HM
7+import qualified Data.Map as Map
88import qualified Data.Text as T
99
1010
@@ -17,7 +17,7 @@ import qualified Data.Text as T
1717class FromJWT a where
1818 decodeJWT :: Jose.ClaimsSet -> Either T.Text a
1919 default decodeJWT :: FromJSON a => Jose.ClaimsSet -> Either T.Text a
20− decodeJWT m = case HM.lookup "dat" (m ^. Jose.unregisteredClaims) of
20+ decodeJWT m = case Map.lookup "dat" (m ^. Jose.unregisteredClaims) of
2121 Nothing -> Left "Missing 'dat' claim"
2222 Just v -> case fromJSON v of
2323 Error e -> Left $ T.pack e