GitXplorerGitXplorer
i

vercel-middleware-auth-demo

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
8696b7f78619ac585be56015375106da7abc5380

Add disclaimer

iiansu committed 2 years ago
Verified
265936c0f4862b235030cbbb592bf46863d2020f

Update README.md

iiansu committed 2 years ago
Verified
7230629d10c889e983132efa73a4d7d8ac56a7bf

Update middleware

iiansu committed 2 years ago
Verified
c1e92d76361bfa2be5bd41f3aeae1249401c40c0

Initial commit

iiansu committed 2 years ago

README

The README file for this repository.

Vercel Middleware Auth Demo

An example that shows how you can use Vercel Middleware to control access to an app

Warning This only provides limited protection and it's easy for users to duplicate the auth cookie. Make sure you understand the risks and tradeoffs before using this in a production application.

This repo includes two apps:

  • Dashboard: An app that you want to password protect
  • Auth: An app that takes a password and sets a cookie to grant access to the dashboard

Demo

https://dashboard.vercel-middleware-auth-demo.iansutherland.dev

You should be asked to login and then redirected back to the dashboard app. You can login with the passwords password and secret.

Development

  1. Run npm install
  2. In one terminal window run npm start -w auth
  3. In another terminal window run npm start -w dashboard
  4. Go to http://localhost:3000