Export the auth stuff for jwt
This commit is contained in:
parent
51a68bd60d
commit
a76b1f9e90
1 changed files with 3 additions and 1 deletions
|
@ -13,6 +13,8 @@ module Servant.Server.Internal.Authentication
|
||||||
, basicAuthStrict
|
, basicAuthStrict
|
||||||
, laxProtect
|
, laxProtect
|
||||||
, strictProtect
|
, strictProtect
|
||||||
|
, jwtAuthHandlers
|
||||||
|
, jwtAuth
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad (guard, (<=<))
|
import Control.Monad (guard, (<=<))
|
||||||
|
@ -133,5 +135,5 @@ jwtAuthHandlers =
|
||||||
-- One can use strictProtect and laxProtect to make more complex authentication
|
-- One can use strictProtect and laxProtect to make more complex authentication
|
||||||
-- and authorization schemes. For an example of that, see our tutorial: @placeholder@
|
-- and authorization schemes. For an example of that, see our tutorial: @placeholder@
|
||||||
jwtAuth :: Secret -> subserver -> AuthProtected (JWT UnverifiedJWT) (JWT VerifiedJWT) subserver 'Strict
|
jwtAuth :: Secret -> subserver -> AuthProtected (JWT UnverifiedJWT) (JWT VerifiedJWT) subserver 'Strict
|
||||||
jwtAuth secret subserver = strictProtect (return . JWT.verify secret) jwtAuthHandlers subserver
|
jwtAuth secret subserver = strictProtect (return . JWT.verify secret) jwtAuthHandlers subserver
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue