Skip to content

Commit 6cbb32c

Browse files
authored
docs: clean up stale warnings, nav CTAs, i18n (#278)
1 parent 46b34a7 commit 6cbb32c

7 files changed

Lines changed: 0 additions & 92 deletions

File tree

docs/content/1.getting-started/0.index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,3 @@ If this is your first setup, follow this order:
113113
3. [Client Setup](/getting-started/client-setup)
114114
4. [Route Protection](/core-concepts/route-protection)
115115
5. [API Reference](/api/composables)
116-
117-
::callout{icon="i-lucide-arrow-right" to="/getting-started/installation"}
118-
Continue to **Installation** for detailed setup options.
119-
::

docs/content/1.getting-started/1.installation.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,3 @@ export default defineClientAuth({})
109109
::callout{icon="i-lucide-hard-drive" to="/guides/custom-database"}
110110
**Bring your own database?** Use Drizzle, Prisma, or Kysely adapters with any database.
111111
::
112-
113-
::callout{icon="i-lucide-arrow-right" to="/getting-started/configuration"}
114-
Continue to **Configuration** to set up these files.
115-
::

docs/content/1.getting-started/2.configuration.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,3 @@ Access sessions from server handlers:
285285
const { user, session } = await getUserSession(event)
286286
if (!user) throw createError({ statusCode: 401 })
287287
```
288-
289-
::callout{icon="i-lucide-arrow-right" to="/getting-started/client-setup"}
290-
Next, set up the **Client Configuration**.
291-
::

docs/content/1.getting-started/3.client-setup.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,3 @@ export default defineClientAuth({
7272
```
7373

7474
:read-more{to="https://www.better-auth.com/docs/plugins" title="All Better Auth plugins"}
75-
76-
::callout{icon="i-lucide-arrow-right" to="/getting-started/type-augmentation"}
77-
Learn how to enable **Type Augmentation** for full type safety.
78-
::

docs/content/1.getting-started/4.type-augmentation.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,3 @@ Otherwise, Nuxt/TypeScript may not pick them up and your augmentation will have
9292
2. Run `npx nuxi prepare` to regenerate types
9393
3. Check that your `server/auth.config.ts` has no syntax errors
9494
4. Ensure your augmentation `.d.ts` file is included by TypeScript (see note above)
95-
96-
::callout{icon="i-lucide-arrow-right" to="/getting-started/how-it-works"}
97-
Now that you are set up, learn **How it Works**.
98-
::

docs/content/4.integrations/1.nuxthub.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ NuxtHub provides the easiest way to add database persistence to your authenticat
99
NuxtHub is vendor-agnostic. Deploy to Cloudflare, Vercel, or self-host. See [NuxtHub deployment docs](https://hub.nuxt.com/docs/getting-started/deploy).
1010
::
1111

12-
::warning{icon="i-lucide-flask-conical"}
13-
**Beta Requirement**: Schema generation requires `better-auth` beta. Install with `pnpm add better-auth@beta`.
14-
::
15-
1612
## Features
1713

1814
- **Auto Schema Generation** - Tables for users, sessions, accounts created automatically

docs/content/4.integrations/4.i18n.md

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -94,59 +94,6 @@ const localizedErrorMessage = computed(() => {
9494

9595
This pattern uses typed `error.code` for translation and falls back to `error.message` when no localized key exists.
9696

97-
## App-Local Message Resolver
98-
99-
For a reusable message resolver across auth and plugin actions, keep it app-local:
100-
101-
```ts [app/utils/auth-error.ts]
102-
type AuthErrorLike = {
103-
message?: string
104-
code?: string
105-
status?: number
106-
}
107-
108-
interface ResolveAuthErrorMessageOptions {
109-
fallback?: string
110-
translate?: (ctx: { code?: string, message: string, status?: number }) => string | undefined
111-
}
112-
113-
const DEFAULT_FALLBACK = 'Please try again.'
114-
115-
export function resolveAuthErrorMessage(
116-
error: unknown,
117-
options: ResolveAuthErrorMessageOptions = {},
118-
): string {
119-
const normalized = (typeof error === 'object' && error !== null ? error : {}) as AuthErrorLike
120-
const message = typeof normalized.message === 'string' && normalized.message.length > 0
121-
? normalized.message
122-
: DEFAULT_FALLBACK
123-
124-
const translated = options.translate?.({
125-
code: normalized.code,
126-
message,
127-
status: normalized.status,
128-
})
129-
130-
if (translated)
131-
return translated
132-
133-
return message === DEFAULT_FALLBACK ? (options.fallback || DEFAULT_FALLBACK) : message
134-
}
135-
```
136-
137-
```ts [pages/login.vue]
138-
const { t, te } = useI18n()
139-
140-
const message = resolveAuthErrorMessage(signInEmail.error.value, {
141-
translate: ({ code }) => {
142-
if (!code)
143-
return
144-
const key = `auth.errors.${code}`
145-
return te(key) ? t(key) : undefined
146-
},
147-
})
148-
```
149-
15097
## Server-Side Locale Detection
15198

15299
For auth config callbacks like `sendResetPassword`, use `@intlify/utils/h3` to detect the user's locale:
@@ -173,21 +120,6 @@ export default defineServerAuth(() => ({
173120
}))
174121
```
175122

176-
## Error Codes Reference
177-
178-
| Code | Default Message |
179-
|------|-----------------|
180-
| `USER_NOT_FOUND` | User not found |
181-
| `INVALID_PASSWORD` | Invalid password |
182-
| `INVALID_EMAIL_OR_PASSWORD` | Invalid email or password |
183-
| `EMAIL_NOT_VERIFIED` | Email not verified |
184-
| `SESSION_EXPIRED` | Session expired |
185-
| `INVALID_TOKEN` | Invalid token |
186-
| `USER_ALREADY_EXISTS` | User already exists |
187-
| `INVALID_EMAIL` | Invalid email |
188-
| `PASSWORD_TOO_SHORT` | Password too short |
189-
| `RATE_LIMIT_EXCEEDED` | Too many requests |
190-
191123
::callout{icon="i-lucide-book" to="https://www.better-auth.com/docs/concepts/client#error-codes"}
192124
See [Better Auth Error Codes](https://www.better-auth.com/docs/concepts/client#error-codes) for the complete list of error codes.
193125
::

0 commit comments

Comments
 (0)