Files
netris-nestri/packages/auth
Wanjohi 74391714d0 feat(auth): draw the sign-in screen in the product's design language
The screen was still the upstream template's: its font, its accent, its
logo, and a theme that tried to serve a light and a dark scheme from one
set of colours by deriving each one from the background's lightness.

That derivation is replaced with stated values, and the page is dark only.
Black, a neutral grey ramp, one brand accent, Mona Sans for the display
line and Geist for anything read or typed; two dashed bands closing into a
box on a wide screen, a dashed vertical either side of the column, the
wordmark, and the line of copy the rest of the product opens with.

The email field keeps the fix from the previous commit and takes the brand
colour on focus, which is the only place it appears besides the wordmark.

Measured against a render of the same design built from its own source:
the band rules, the column rules, the wordmark box and the button height
land on identical pixels.
2026-09-17 23:05:39 +03:00
..
2026-08-06 22:13:51 +03:00
2026-08-06 22:13:51 +03:00
2026-08-06 22:32:33 +03:00
2026-08-06 22:13:51 +03:00

packages/auth (@nestri/auth)

Framework-agnostic OpenAuth implementation for Nestri — the OAuth/OIDC issuer, client, subjects, and the login UI. A vendored/forked build of OpenAuth.

What it does

Everything needed to run your own authentication provider:

  • issuer.ts — the authorization server: routes for /authorize, /callback, /token, /userinfo, .well-known/*, plus the login UI (React renderer).
  • client.tscreateClient to verify JWTs against the issuer ("who is this token?").
  • subject.ts — typed JWT subjects (zod schemas for the token payload).
  • provider/* — drop-in OAuth/OIDC providers (steam, discord, github, google, apple, microsoft, slack, spotify, twitch, x, yahoo, facebook, linkedin, cognito, keycloak, jumpcloud, oauth2, oidc, password, ssh, code, arctic).
  • storage/* — persistence adapters for keys/sessions/codes: memory, cloudflare (KV), aws, dynamo.
  • ui/* — the login page components (forms, password, code, theme, CSS).
  • jwt.ts, keys.ts, pkce.ts, random.ts — signing, keypair management, PKCE, randomness.

Usage

Consumed by the apps/auth worker, e.g.:

import { issuer } from '@nestri/auth/index';
import { CloudflareStorage } from '@nestri/auth/storage/cloudflare';
import { SteamProvider } from '@nestri/auth/provider/steam';

The API uses createClient (from @openauth/openauth/client) or the bundled client.ts to verify tokens against the issuer URL.

Scripts

bun test      # run tests
bun run build # build (see script/build.ts)

Note

@openauthjs is the upstream project; this package's exports are meant to be API-compatible with a pinned preference toward tree-shaking-friendly imports. Prefer importing subpaths over the barrel (@nestri/auth/index).