File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -55,10 +55,9 @@ decodeClaims _ = throwError $ JwtErr $ JwtDecodeErr UnsupportedTokenType
5555validateClaims :: MonadError Error m => UTCTime -> (Text -> Bool ) -> JSON. Object -> m ()
5656validateClaims time audMatches claims = liftEither $ maybeToLeft () (fmap JwtErr . getAlt $ JwtClaimsErr <$> checkForErrors time audMatches claims)
5757
58- data ValidAud = VANull | VAString Text | VAArray [Text ] deriving Generic
58+ data ValidAud = VAString Text | VAArray [Text ] deriving Generic
5959instance JSON. FromJSON ValidAud where
60- parseJSON JSON. Null = pure VANull
61- parseJSON o = JSON. genericParseJSON JSON. defaultOptions { JSON. sumEncoding = JSON. UntaggedValue } o
60+ parseJSON = JSON. genericParseJSON JSON. defaultOptions { JSON. sumEncoding = JSON. UntaggedValue }
6261
6362checkForErrors :: (Applicative m , Monoid (m JwtClaimsError )) => UTCTime -> (Text -> Bool ) -> JSON. Object -> m JwtClaimsError
6463checkForErrors time audMatches = mconcat
@@ -82,7 +81,6 @@ checkForErrors time audMatches = mconcat
8281 validAud = \ case
8382 (VAString aud) -> audMatches aud
8483 (VAArray auds) -> null auds || any audMatches auds
85- _ -> True
8684
8785 checkValue invalid msg val =
8886 if invalid val then
You can’t perform that action at this time.
0 commit comments