JWT: Protect Only Selected Routes
Gate only sensitive endpoints by setting `auth: true` where it matters instead of forcing auth on the whole API.
When to use this
What this does not do
Repo-grounded example
{
"authorizer": {
"type": "jwt",
"secret": "$env.JWT_SECRET",
"algorithm": "HS256",
"issuer": "https://issuer.example.com",
"audience": "api-audience"
},
"paths": [
{
"method": "GET",
"path": "/private",
"auth": true,
"response": { "private": true }
}
]
}Troubleshooting
Related docs
Last updated