https://github.com/mause/vercel-jwt-auth
https://github.com/mause/vercel-jwt-auth
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mause/vercel-jwt-auth
- Owner: Mause
- License: mit
- Created: 2021-08-22T09:05:42.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-02T09:58:43.000Z (over 1 year ago)
- Last Synced: 2025-01-10T13:00:11.334Z (over 1 year ago)
- Language: TypeScript
- Size: 312 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vercel-jwt-auth
This provides a very simple function to wrap handlers in vercel, with jwt verification - the only parameter is the secret to verify the jwt
```typescript doctest
import { supabase, VercelRequestWithUser } from "../src/vercel-jwt-auth";
const SECRET = "...";
const endpoint = supabase(SECRET)((req: VercelRequestWithUser, res) => {
console.log(req.user);
res.status(200);
res.json("OK");
});
```