Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class FromJWT a where
- class ToJWT a where
- jwtAuthCheck :: FromJWT usr => JWTSettings -> AuthCheck usr
- makeJWT :: ToJWT a => a -> JWTSettings -> Maybe UTCTime -> IO (Either Error ByteString)
Documentation
class FromJWT a where Source #
How to decode data from a JWT.
The default implementation assumes the data is stored in the unregistered
dat
claim, and uses the FromJSON
instance to decode value from there.
How to encode data from a JWT.
The default implementation stores data in the unregistered dat
claim, and
uses the type's ToJSON
instance to encode the data.
jwtAuthCheck :: FromJWT usr => JWTSettings -> AuthCheck usr Source #
A JWT AuthCheck
. You likely won't need to use this directly unless you
are protecting a Raw
endpoint.