0.0.0 • Published 1 year ago

edgy-auth v0.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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,
--     last_login: number,
--     display_name: string,
--     photo: 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