SERVER BLOCK / AUTH

Auth state shared with Views

Register and login create an opaque ULID session, persist it in Database, cache it for fast validation, and update one shared View Store.

LIVE SESSION

One auth state, two sides

SIGNED INGUEST

Create an account or sign in. The CRUD block reads this same Store and enables its protected actions.

Authenticated as

Open CRUD to create, update, and delete with this session.

REGISTER

Password

LOGIN

Password

SOURCE FILES

Cache-aside auth without client secrets

The token carries only a ULID. Middleware verifies it through Cache first and Database second; the View Store contains display state and the bearer value, never provider credentials.

dowe
import exampleSession from "@/views/store/example-session"

fn login
  request result method:"POST" route:"/api/examples/auth/login" body:loginForm
  if result.ok
    set exampleSession value:result.data

Text show:exampleSession.authenticated
  "Authenticated as"
Text show:exampleSession.authenticated
  "{exampleSession.user.name}"