Skip to main content

authentication

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

来源信息

仓库
latitude-dev/latitude-llm
最近来源活动
2026年3月31日 12:27
检测到的 SKILL.md 语言
英语
星标
4,722
分支
402

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
authentication
description
Sessions, sign-in/sign-up flows, OAuth, magic links, or organization context on the session.
# 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](../architecture-boundaries/SKILL.md).
在 GitHub 查看