Skip to content

Commit

Permalink
docs(readme): updated how it works section based on jwt update
Browse files Browse the repository at this point in the history
  • Loading branch information
leeuwis authored Apr 16, 2021
1 parent aac7f54 commit 9acdbe0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

This library adds a password prompt to your Next.js deployment. It consists of two main parts:
1. Two serverless API routes:
- A login route that checks if a password is correct and sets a cookie in case it is. The value of the cookie is the password base64 encoded.
- A check route that validates if you have the authorization cookie with the correct password.
- A login route that checks if a password is correct and sets a cookie with a JWT in case it is.
- A check route that validates if you have the authorization cookie with a valid JWT.
2. A HOC ([Higher-Order Component](https://reactjs.org/docs/higher-order-components.html)) that wraps Next.js App and adds a check that validates if you are logged in. If you do, then you can view the app normally; otherwise, you are presented with a password prompt.

**Important**: The recommended use case for this library is in a staging or preview environment. By taking advantage of webpack's `DefinePlugin`, we can make sure this library is only included in certain environments, keeping the production bundle size small.
Expand Down

1 comment on commit 9acdbe0

@vercel
Copy link

@vercel vercel bot commented on 9acdbe0 Apr 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.