https://github.com/3ru/basic-auth-password
Vercel's edge middleware testing
https://github.com/3ru/basic-auth-password
Last synced: about 5 hours ago
JSON representation
Vercel's edge middleware testing
- Host: GitHub
- URL: https://github.com/3ru/basic-auth-password
- Owner: 3ru
- Created: 2023-04-04T15:53:54.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-04T16:06:17.000Z (about 3 years ago)
- Last Synced: 2025-02-25T14:49:46.676Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://basic-auth-password-navy.vercel.app
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
name: Basic Auth Password Protection
slug: basic-auth-password
description: Password protect pages in your application using Edge Middleware.
framework: Next.js
useCase: Edge Middleware
css: Tailwind
deployUrl: https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/edge-middleware/basic-auth-password&project-name=basic-auth-password&repository-name=basic-auth-password
demoUrl: https://edge-functions-basic-auth-password.vercel.app
relatedTemplates:
- jwt-authentication
- subdomains-auth
---
# Basic Auth Password Protection
Password protect pages in your application using Edge Middleware.
## Demo
https://edge-functions-basic-auth-password.vercel.app
Login credentials:
- Username: `4dmin`
- Password: `testpwd123`
## How to Use
You can choose from one of the following two methods to use this repository:
### One-Click Deploy
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=vercel-examples):
[](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/examples/tree/main/edge-middleware/basic-auth-password&project-name=basic-auth-password&repository-name=basic-auth-password)
### Clone and Deploy
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
```bash
npx create-next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/basic-auth-password basic-auth-password
# or
yarn create next-app --example https://github.com/vercel/examples/tree/main/edge-middleware/basic-auth-password basic-auth-password
```
Next, run Next.js in development mode:
```bash
npm install
npm run dev
# or
yarn
yarn dev
```
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=edge-middleware-eap) ([Documentation](https://nextjs.org/docs/deployment)).