No description
Find a file
Randall Stillwell 875b1cfc87 auth: case-insensitive emails, Authentik SSO, first-signin workspace provisioning
Three pieces of authentication work that need to land together so OAuth
sign-ins produce a usable session.

* `ensureUserIdByEmail` upserts a `users` row on every OAuth sign-in
  matched case-insensitively on email, then stamps `token.id` with the
  resulting UUID so workspace-scoped tRPC procedures can resolve
  membership. Credentials sign-in already returned the DB id from
  `authorize`; OAuth now does the equivalent.
* `ensureUserHasWorkspace` mints a personal workspace (and `owner`
  member row) on first sign-in for any user that doesn't already
  belong to one, so fresh OAuth accounts don't land in the app with
  no tenant scope. Idempotent; slug collisions retry with a random
  suffix and cap at 5 attempts.
* Migration 0004 adds a `UNIQUE (lower(email))` index on `users` to
  match the lookup pattern and prevent two providers from minting
  rows that differ only in casing. Existing rows are normalized to
  lowercase first; the column-level UNIQUE catches any pre-existing
  duplicates so they get resolved by a human rather than silently
  merged.

Sign-in / sign-up pages add an Authentik SSO button (gated on
`AUTH_AUTHENTIK_*` env vars). Layout switches to GitHub+Google on top
with Authentik full-width below.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-01 23:45:00 -05:00
.cursor/rules docs: add AGENTS.md and Cursor rules 2026-05-06 22:14:16 -05:00
apps auth: case-insensitive emails, Authentik SSO, first-signin workspace provisioning 2026-06-01 23:45:00 -05:00
config feat: ECHODO app shell, Coolify deploy, Authentik + Umami 2026-04-26 14:34:34 -05:00
docker docker: raise web build V8 heap to 5 GB to match 8 GB host 2026-04-28 13:33:46 -05:00
docs feat: ECHODO app shell, Coolify deploy, Authentik + Umami 2026-04-26 14:34:34 -05:00
packages auth: case-insensitive emails, Authentik SSO, first-signin workspace provisioning 2026-06-01 23:45:00 -05:00
plans feat: ECHODO app shell, Coolify deploy, Authentik + Umami 2026-04-26 14:34:34 -05:00
.env.example feat: ECHODO app shell, Coolify deploy, Authentik + Umami 2026-04-26 14:34:34 -05:00
.gitignore feat: ECHODO app shell, Coolify deploy, Authentik + Umami 2026-04-26 14:34:34 -05:00
AGENTS.md docs: add AGENTS.md and Cursor rules 2026-05-06 22:14:16 -05:00
package.json feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
pnpm-lock.yaml collab: replace createRequire shim with normal imports 2026-04-28 15:14:03 -05:00
pnpm-workspace.yaml feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
tsconfig.json feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00
turbo.json feat: Full project management application scaffold 2026-03-26 22:39:16 -05:00