From efffc70919a1f8bdc9624640b9d08190ed506c7f Mon Sep 17 00:00:00 2001 From: akhesacaro Date: Sun, 14 Nov 2021 14:33:43 +0100 Subject: [PATCH] fixing servant-auth (aeson 2.0 bump) --- servant-auth/servant-auth/servant-auth.cabal | 1 - servant-auth/servant-auth/src/Servant/Auth/JWT.hs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/servant-auth/servant-auth/servant-auth.cabal b/servant-auth/servant-auth/servant-auth.cabal index 22c834e5..49a4605e 100644 --- a/servant-auth/servant-auth/servant-auth.cabal +++ b/servant-auth/servant-auth/servant-auth.cabal @@ -40,7 +40,6 @@ library , lens >= 4.16.1 && < 5.1 , servant >= 0.15 && < 0.19 , text >= 1.2.3.0 && < 1.3 - , unordered-containers >= 0.2.9.0 && < 0.3 exposed-modules: Servant.Auth Servant.Auth.JWT diff --git a/servant-auth/servant-auth/src/Servant/Auth/JWT.hs b/servant-auth/servant-auth/src/Servant/Auth/JWT.hs index f02494ba..8240770f 100644 --- a/servant-auth/servant-auth/src/Servant/Auth/JWT.hs +++ b/servant-auth/servant-auth/src/Servant/Auth/JWT.hs @@ -4,7 +4,7 @@ import Control.Lens ((^.)) import qualified Crypto.JWT as Jose import Data.Aeson (FromJSON, Result (..), ToJSON, fromJSON, toJSON) -import qualified Data.HashMap.Strict as HM +import qualified Data.Map as Map import qualified Data.Text as T @@ -17,7 +17,7 @@ import qualified Data.Text as T class FromJWT a where decodeJWT :: Jose.ClaimsSet -> Either T.Text a default decodeJWT :: FromJSON a => Jose.ClaimsSet -> Either T.Text a - decodeJWT m = case HM.lookup "dat" (m ^. Jose.unregisteredClaims) of + decodeJWT m = case Map.lookup "dat" (m ^. Jose.unregisteredClaims) of Nothing -> Left "Missing 'dat' claim" Just v -> case fromJSON v of Error e -> Left $ T.pack e