sonamu-auth
Installation
SKILL.md
better-auth in Sonamu
Sonamu owns the schema and the request plumbing; better-auth owns the credential and session logic. Three things have to line up, in this order:
pnpm sonamu auth generatewrites the entity JSONs.pnpm sonamu migrate generate, thenmigrate run --execute --confirm, creates the tables.server.authinsonamu.config.tsturns on the better-auth instance and its routes.
Restricting an endpoint is a separate mechanism: guards and guardHandler enforce nothing
auth-specific and work with no auth block at all. They belong to the sonamu-api skill.
| Need | Read |
|---|---|
| Which plugin adds which tables and fields, and its wrapper | references/plugins.md |
Auth routes, client IP, reading user/session |
references/runtime.md |
additionalFields, SonamuUser, a role column |
references/user-fields.md |