Documentation
¶
Index ¶
Constants ¶
View Source
const AuthUserID = authUserKey("middleware.auth.userID")
Variables ¶
This section is empty.
Functions ¶
func EnsureAuthMiddleware ¶
Middleware to ensure that the user is authenticated Ensure that "ParseAuthMiddleware" is called before this or a 401 will be returned every single time.
func ParseAuthMiddleware ¶
Middleware to pass the user id in the context This middleware will NOT return a 401. It will only attempt to parse the userId from the Authorization header (if any).
Use EnsureAuthMiddleware after this middleware to raise a 401
Types ¶
type Middleware ¶
func CreateStack ¶
func CreateStack(stack ...Middleware) Middleware
To create a stack of middlewares more cleanly
Click to show internal directories.
Click to hide internal directories.