https://github.com/ericadamski/serverless-password
A simple, secure way to create a password checker without needing a server
https://github.com/ericadamski/serverless-password
Last synced: about 1 month ago
JSON representation
A simple, secure way to create a password checker without needing a server
- Host: GitHub
- URL: https://github.com/ericadamski/serverless-password
- Owner: ericadamski
- Created: 2020-02-07T16:05:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T14:35:36.000Z (over 2 years ago)
- Last Synced: 2025-04-02T05:51:43.910Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://paassword.now.sh
- Size: 1.73 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# serverless-password
A simple set of routes for securly storing and testing ad-hoc passwords:
## How to use
1. Go enter the password you want to use here: https://paassword.now.sh
2. Copy the URL given to you from step 1
3. Make a `POST` request to the URL you receive
```JavaScript
import fetch from "unfetch"const response = await fetch("", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ pwd: 'your password attempt' })
})if (response.ok) {
const { valid } = await response.json()console.log(valid) // true || false
}
```## Live example
You can run this in a modern browser console.
> be careful of CORS 😡
```JavaScript
async function validatePassword(pwd) {
const response = await fetch("https://svrlss.now.sh/api/get/rec3T73O3WNZk3IZj", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ pwd })
})if (response.ok) {
const { valid } = await response.json()console.log(
valid
? "You entered the correct password! 👏"
: "The password you entered is incorrect. 😭"
)
}
}validatePassword("test") /* the real password is dev.to */
```