Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Protect your vals behind a password. Use session cookies to persist authentication.
import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=84";
export default passwordAuth(() => {
return new Response("OK");
}, { verifyPassword: (password) => password == Deno.env.get("VAL_PASSWORD") });
If you want to use an api token to authenticate:
import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=84";
import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
export default passwordAuth(() => {
return new Response("OK");
}, { verifyPassword: verifyToken });
- allow to authenticate using a val town token
- add a way to send an email to ask a password from the val owner
- automatically extend the session
- automatically remove expired sessions
How to sign out ?
Navigate to <your-site>/signout
.