A self-hosted auth api for your products.
The best way to deploy on your cloudflare woker is clicking the button.
Install mise on your device
mise bootstrapcp .env.example .envFollow the instructions in your .env and configure your .env
Run the following command to get DB_UUID and set DB_UUID in .env
cf d1 create --name auth-workerMigrate tables in your local d1 database
cf d1 migrations apply $DB_UUID --localRun the project
just devjust deployAll responses use the same envelope, including 404/405 and malformed
bodies:
{ "success": true, "errors": [], "messages": ["..."], "results": {} }| Method | Path | Description |
|---|---|---|
| GET | /api/v1/health |
Liveness probe |
| POST | /api/v1/signup |
Create an account |
| POST | /api/v1/signin |
Verify credentials and return the account |
POST /signup takes { "name", "email", "password", "confirm_password" } and
answers 409 when the email is already registered.
POST /signin takes { "email", "password" } and returns the account
(id, name, email, created_at). There is no token: the worker only
authenticates the caller.
Passwords must be 8–64 characters; the upper bound only exists so a request cannot feed an unbounded input to Argon2.
Browser clients are blocked by default. Set CORS_ORIGINS to a comma
separated list of origins (https://app.example.com,http://localhost:5173) or
to * to allow every origin.
See LICENSE.