docs: defineBetterAuthService reference never mentions opt-in user.* flags like deleteUser

Abierto Apto para principiantes
#174 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Busca en el repositorio la skill RelKit incluida y localiza la sección defineBetterAuthService en su referencia data-apis.md. Lee cómo se mantiene ese ejemplo y luego añade una breve explicación y un ejemplo de opciones user.* optativas, como deleteUser. La tarea estará terminada cuando la referencia deje claro que la opción está desactivada de forma predeterminada y muestre cómo activarla.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

documentation good first issue
Page or file

The bundled RelKit skill's defineBetterAuthService reference. In an installed project it lands at .agents/skills/relkit/references/data-apis.md (section ## defineBetterAuthService); I couldn't find the equivalent path in this monorepo's source, but a repo-wide search for the skill content should find it quickly.

Problem
  • Missing
Details

The entire defineBetterAuthService example in the skill is:

import { defineBetterAuthService } from "@relkit/better-auth";

export default defineBetterAuthService({
  baseURL: process.env.BETTER_AUTH_URL ?? "http://127.0.0.1:3000",
  emailAndPassword: { enabled: true },
});

That's the only config surface the skill shows. It never mentions that Better Auth's user.* options exist or that several of them are opt-in and off by default - deleteUser in particular.

Why this is worth documenting: Better Auth defines POST /api/auth/delete-user unconditionally (its OpenAPI metadata is attached at endpoint-definition time, in better-auth/dist/api/routes/update-user.mjs), so it always shows up in the generated OpenAPI spec / Scalar docs for a RelKit app that scaffolds Better Auth. But the handler body gates on ctx.context.options.user?.deleteUser?.enabled and throws a bare APIError.fromStatus("NOT_FOUND") (empty body, no error code) when that flag isn't set - which it never is unless you explicitly add user: { deleteUser: { enabled: true } } }.

Net effect for anyone following only the skill's example: your app's Scalar docs advertise a working "delete my account" endpoint that 404s with no explanation, and there's nothing in the skill that would lead you to user.deleteUser to notice the gap. I only found the root cause by reading better-auth's source directly.

Suggested fix: extend the defineBetterAuthService reference section to at least name the existence of opt-in user.* feature flags (deleteUser, and similarly email-verification/password-reset's sender callbacks), with a one-line example like:

user: {
  deleteUser: { enabled: true }, // off by default; route 404s until set
},

so an agent/developer scaffolding auth knows these exist and can decide for themself whether to turn them on, rather than discovering it as a silent 404 in production docs.

(Context, not something to fix here: the bare/empty-body 404 on a disabled Better Auth feature is better-auth's own behavior, not RelKit's - flagging only in case it's useful upstream.)


Found while doing an exhaustive route-by-route test pass (151 requests across all 81 OpenAPI endpoints) on an app scaffolded with @relkit/[email protected] / @relkit/[email protected].

Lenguaje dominante
TypeScript
Estrellas
1
Forks
0
Merge medio
2 h 45 min
PR fusionados (30 d)
64

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rel-kit/relkit

Todos los issues de rel-kit/relkit

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.