Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Val Town Token Session Auth

Protect your vals behind your Val Town API Token. Use session cookies to persist authentication.

Forked from @pomdtr/password_auth.

Usage

import { vtTokenSessionAuth } from "https://esm.town/v/stevekrouse/vtTokenSessionAuthSafe"; export default vtTokenSessionAuth(() => Response.json("Authenticated!"))

To sign out, navigate to /signout.

Migrated from folder: Archive/vtTokenSessionAuth