The example shows how to do JWT authentication at the edge using Edge Middleware and Edge Functions.
https://edge-functions-jwt-authentication.vercel.app
Visit the demo to learn more about how it works!
You can choose from one of the following two methods to use this repository:
After setting up your JWT secret, deploy the example using Vercel:
Execute create-next-app
with npm or Yarn to bootstrap the example:
Set up environment variables
pnpm create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/jwt-authentication
Rename .env.example
to .env.local
:
cp .env.example .env.local
then, update JWT_SECRET_KEY
with your a random secret that'll be used to sign JWTs.
Next, run Next.js in development mode:
pnpm dev
The app should be up and running at http://localhost:3000.
Deploy it to the cloud with Vercel (Documentation).
The example shows how to do JWT authentication at the edge using Edge Middleware and Edge Functions.
https://edge-functions-jwt-authentication.vercel.app
Visit the demo to learn more about how it works!
You can choose from one of the following two methods to use this repository:
After setting up your JWT secret, deploy the example using Vercel:
Execute create-next-app
with npm or Yarn to bootstrap the example:
Set up environment variables
pnpm create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/jwt-authentication
Rename .env.example
to .env.local
:
cp .env.example .env.local
then, update JWT_SECRET_KEY
with your a random secret that'll be used to sign JWTs.
Next, run Next.js in development mode:
pnpm dev
The app should be up and running at http://localhost:3000.
Deploy it to the cloud with Vercel (Documentation).