/auth
Search
⌃K

Express

SlashAuth provides middleware to simplify access to an app's APIs. This documentation covers how to validate tokens and restrict API access to specific roles for Express and NextJS.
Middleware Function
Description
​validateTokens​
Middleware the takes the request, parses the token, and add the claims directly into the request.
​hasRole​
Middleware that verifies that the token-holder has the specified roles. Returns a 403 if the user is not authorized.