OpenParable
Skip to content
← Back to skills

Authentication

Development
authentication

Authentication is an Agent Skill for development published in the latitude-dev/latitude-llm repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Sessions, sign-in/sign-up flows, OAuth, magic links, or organization context on the session.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/latitude-dev/latitude-llm/blob/HEAD/.agents/skills/authentication/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/authentication, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Authentication (Better Auth)

When to use: Sessions, sign-in/sign-up flows, OAuth, magic links, or organization context on the session.

Stack

  • @platform/db-postgres exposes createBetterAuth() in packages/platform/db-postgres/src/create-better-auth.ts, wiring better-auth with the Drizzle adapter against the shared Postgres client.
  • Sessions: auth.api.getSession({ headers }) → { user, session } with typed fields.
  • User includes id, email, name — use those fields directly (no assertions).

Web app helpers

  • Session helpers: apps/web/src/domains/sessions/session.functions.ts (getSession, ensureSession, etc.).
  • Organization context is added via the customSession plugin (multi-tenant product behavior).

Domain alignment

  • Auth intent flows (login/signup completion) use use-cases from @domain/auth composed with Postgres repositories — keep policy in domain, wiring in apps.

For HTTP boundary rules (who may call what), see architecture-boundaries.