Edgy Auth
this project is an extention of my standard auth system backed by a database.
the idea is to make user authentication easy and simple on the edge.
design
backed by a d1 users table
cache authenticated seasions in kv store
binding
d1 = UGC
kv = edgy
Schema
this depends on the fields
CREATE TABLE users (
id: string,
username: string,
email: string,
password: string,
)
Design requirements.
-
GET, POST, login
-
GET, logout
-
GET, POST, register
-
POST, token
-
GET, POST profile
templates: login, register, profile
dev: middleware, config
Cloudflare.
So the point is you can put this edge router in front of your pages function or an external application.
Sample use cases
Pages
import