Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3d1e215

Browse files
authoredMar 9, 2025··
docs: Reapply "docs: exclude inherits, update deps (#12628)" (#12645) (#12690)
* Reapply "docs: exclude inherits, update deps (#12628)" (#12645) This reverts commit d47bb20.
1 parent 3664aa5 commit 3d1e215

File tree

21 files changed

+271
-105
lines changed

21 files changed

+271
-105
lines changed
 

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ packages/next-auth/providers
3232
# copied from @auth/core
3333
packages/frameworks-*/**/providers
3434
packages/*/*.js
35+
!packages/*/typedoc.config.js
3536
packages/*/*.d.ts
3637
packages/*/*.d.ts.map
3738
packages/*/lib

‎docs/next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default withNextra({
7272
{
7373
source: "/:path(.*)",
7474
has: [{ type: "host", value: "warnings.authjs.dev" }],
75-
destination: "https://authjs.dev/reference/warnings/:path*",
75+
destination: "https://authjs.dev/reference/core/types#warningcode",
7676
permanent: true,
7777
},
7878
{

‎docs/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"start": "next start",
1212
"lint": "eslint ./{components,pages,utils}",
1313
"lint:fix": "eslint ./{components,pages,utils} --fix",
14-
"build:sitemap": "next-sitemap --config next-sitemap.config.cjs"
14+
"build:sitemap": "next-sitemap --config next-sitemap.config.cjs",
15+
"clean": "rm -rf .next build pages/reference/*.mdx pages/reference/**/*"
1516
},
1617
"repository": {
1718
"type": "git",
@@ -49,8 +50,9 @@
4950
"postcss": "^8.4.47",
5051
"shiki": "^1.22.0",
5152
"tailwindcss": "^3.4.13",
52-
"typedoc": "^0.25.13",
53-
"typedoc-plugin-markdown": "4.0.0-next.54",
54-
"typedoc-plugin-mdn-links": "^3.3.2"
53+
"typedoc": "^0.27.6",
54+
"typedoc-plugin-markdown": "4.3.3",
55+
"typedoc-plugin-mdn-links": "4.0.11",
56+
"typedoc-plugin-no-inherit": "^1.5.0"
5557
}
5658
}

‎docs/pages/reference/_meta.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ export default {
1010
express: "@auth/express",
1111
qwik: "@auth/qwik",
1212
"solid-start": "@auth/solid-start",
13-
warnings: "Warnings",
14-
errors: {
15-
title: "Errors",
16-
href: "/reference/core/errors",
17-
},
1813
"--- adapters": {
1914
type: "separator",
2015
title: "Adapters",
@@ -33,6 +28,7 @@ export default {
3328
"mikro-orm-adapter": "@auth/mikro-orm-adapter",
3429
"mongodb-adapter": "@auth/mongodb-adapter",
3530
"neo4j-adapter": "@auth/neo4j-adapter",
31+
"neon-adapter": "@auth/neon-adapter",
3632
"pg-adapter": "@auth/pg-adapter",
3733
"pouchdb-adapter": "@auth/pouchdb-adapter",
3834
"sequelize-adapter": "@auth/sequelize-adapter",

‎docs/pages/reference/warnings.mdx

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎docs/typedoc-nextauth.cjs renamed to ‎docs/typedoc-nextauth.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// @ts-check
22

3-
const { MarkdownPageEvent } = require("typedoc-plugin-markdown")
4-
const path = require("path")
5-
const fs = require("fs")
3+
import { MarkdownPageEvent } from "typedoc-plugin-markdown"
4+
import path from "path"
5+
import fs from "fs"
66

77
/**
88
* Local plugin to tweak TypeDoc output for nextra docs
99
*
1010
* @param {import("typedoc-plugin-markdown").MarkdownApplication} app
1111
*/
12-
module.exports.load = (app) => {
12+
export function load(app) {
1313
injectNextraCalloutImport(app)
1414
parseOutput(app)
1515
writeMetaJsFiles(app)
@@ -57,7 +57,7 @@ function parseOutput(app) {
5757
const replaceCodeBlockTitle = (match, p1, p2, p3) => `${p1}filename="${p3}"`
5858

5959
page.contents = page.contents
60-
.replace(calloutRegex, replaceCallout)
60+
?.replace(calloutRegex, replaceCallout)
6161
.replace(codeBlockRegex, replaceCodeBlockTitle)
6262
})
6363
}
@@ -82,7 +82,7 @@ function writeMetaJsFiles(app) {
8282
) => {
8383
const pages = defaultValue
8484
navigationItems.forEach((item) => {
85-
const pageKey = item.url ? path.parse(item.url).name : null
85+
const pageKey = item.path ? path.parse(item.path).name : null
8686
if (pageKey) {
8787
pages[pageKey] = item.title
8888
if (item?.children && item?.children?.length > 0) {
@@ -101,15 +101,19 @@ function writeMetaJsFiles(app) {
101101

102102
const metaJString = `
103103
export default ${JSON.stringify(pages, null, 2)}`
104+
104105
if (new RegExp(".*docs/pages/reference$").test(outputDirectory)) return
106+
105107
fs.writeFileSync(path.join(outputDirectory, "_meta.js"), metaJString)
106108
}
107109

108110
/**
109111
* Recursively write _meta.js files for each page based on output.navigation
110112
*/
111-
writeMetaJs(output.navigation, output.outputDirectory, {
112-
overview: "Overview",
113-
})
113+
if (output.navigation) {
114+
writeMetaJs(output.navigation, output.outputDirectory, {
115+
overview: "Overview",
116+
})
117+
}
114118
})
115119
}

‎docs/typedoc.config.cjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ module.exports = {
2424
tsconfig: "./tsconfig.json",
2525
plugin: [
2626
"typedoc-plugin-markdown",
27-
require.resolve("./typedoc-nextauth.cjs"),
27+
require.resolve("./typedoc-nextauth.js"),
2828
"typedoc-plugin-mdn-links",
29+
"typedoc-plugin-no-inherit",
2930
],
3031
disableSources: true,
3132
excludeNotDocumented: true,
3233
excludeExternals: true,
3334
excludeInternal: true,
34-
excludePrivate: true,
3535
excludeProtected: true,
36+
excludeReferences: true,
3637
cleanOutputDir: false,
3738
gitRevision: "main",
3839
githubPages: false,
@@ -75,8 +76,5 @@ module.exports = {
7576
expandObjects: true,
7677
parametersFormat: "table",
7778
indexFormat: "table",
78-
textContentMappings: {
79-
"label.packages": "Integrations",
80-
},
8179
useCodeBlocks: true,
8280
}

‎packages/adapter-kysely/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: 16}}>
33
* <p>Official <a href="https://kysely.dev/">Kysely</a> adapter for Auth.js / NextAuth.js.</p>
44
* <a href="https://kysely.dev/">
5-
* <img style={{display: "block"}} src="/img/adapters/kysely.svg" width="38" />
5+
* <img style={{display: "block"}} src="https://authjs.dev/img/adapters/kysely.svg" width="30" />
66
* </a>
77
* </div>
88
*
99
* ## Installation
1010
*
1111
* ```bash npm2yarn
12-
* npm install kysely @auth/kysely-adapter
12+
* npm install @auth/kysely-adapter kysely
1313
* ```
1414
*
1515
* @module @auth/kysely-adapter
1616
*/
17-
1817
import { Kysely, SqliteAdapter } from "kysely"
1918

2019
import {
@@ -205,6 +204,7 @@ export function KyselyAdapter(db: Kysely<Database>): Adapter {
205204
* requires. When used with `kysely-codegen`, the `Codegen` type can be passed as
206205
* the second generic argument. The generated types will be used, and
207206
* `KyselyAuth` will only verify that the correct fields exist.
207+
* @noInheritDoc
208208
*/
209209
export class KyselyAuth<DB extends T, T = Database> extends Kysely<DB> {}
210210

‎packages/adapter-mongodb/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface MongoDBAdapterOptions {
5252
databaseName?: string
5353
/**
5454
* Callback function for managing the closing of the MongoDB client.
55-
* This could be useful when `client` is provided as a function returning MongoClient | Promise<MongoClient>.
55+
* This could be useful when `client` is provided as a function returning MongoClient.
5656
* It allows for more customized management of database connections,
5757
* addressing persistence, container reuse, and connection closure issues.
5858
*/
@@ -115,7 +115,7 @@ export function MongoDBAdapter(
115115
* - A promise that resolves to a connected `MongoClient` (not recommended).
116116
* - A function, to handle more complex and custom connection strategies.
117117
*
118-
* Using a function that returns `MongoClient | Promise<MongoClient>`, combined with `options.onClose`, can be useful when you want a more advanced and customized connection strategy to address challenges related to persistence, container reuse, and connection closure.
118+
* Using a function combined with `options.onClose`, can be useful when you want a more advanced and customized connection strategy to address challenges related to persistence, container reuse, and connection closure.
119119
*/
120120
client:
121121
| MongoClient

‎packages/adapter-prisma/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"access": "public"
3838
},
3939
"scripts": {
40-
"clean": "rm ./prisma/dev.db* || echo 'File deleted' && rm -rf *.js *.d.ts*",
40+
"clean": "rm ./prisma/dev.db* || echo 'File deleted' && rm -rf index.js *.d.ts*",
4141
"init:default": "prisma migrate dev --name init --skip-seed",
4242
"init:custom": "prisma migrate dev --name init-custom --schema ./prisma/custom.prisma",
4343
"test:default": "pnpm init:default && vitest run -c ../utils/vitest.config.ts",

‎packages/adapter-prisma/typedoc.config.cjs

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
entryPoints: ["src/index.ts"],
3+
entryPointStrategy: "expand",
4+
tsconfig: "./tsconfig.json",
5+
entryModule: "@auth/prisma-adapter",
6+
entryFileName: "../prisma-adapter.mdx",
7+
includeVersion: true,
8+
readme: 'none',
9+
};

‎packages/core/src/errors.ts

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,24 @@ type ErrorType =
3838
* Base error class for all Auth.js errors.
3939
* It's optimized to be printed in the server logs in a nicely formatted way
4040
* via the [`logger.error`](https://authjs.dev/reference/core#logger) option.
41+
* @noInheritDoc
4142
*/
4243
export class AuthError extends Error {
43-
/** The error type. Used to identify the error in the logs. */
44+
/** The error type. Used to identify the error in the logs.
45+
* @internal
46+
*/
4447
type: ErrorType
4548
/**
4649
* Determines on which page an error should be handled. Typically `signIn` errors can be handled in-page.
4750
* Default is `"error"`.
4851
* @internal
4952
*/
5053
kind?: "signIn" | "error"
54+
55+
/** @internal */
5156
cause?: Record<string, unknown> & { err?: Error }
57+
58+
/** @internal */
5259
constructor(
5360
message?: string | Error | ErrorOptions,
5461
errorOptions?: ErrorOptions
@@ -77,7 +84,12 @@ export class AuthError extends Error {
7784
}
7885
}
7986

87+
/**
88+
* Thrown when the user's sign-in attempt failed.
89+
* @noInheritDoc
90+
*/
8091
export class SignInError extends AuthError {
92+
/** @internal */
8193
static kind = "signIn"
8294
}
8395

@@ -93,16 +105,20 @@ export class SignInError extends AuthError {
93105
* { "args": [undefined] }
94106
* ```
95107
* :::
108+
* @noInheritDoc
96109
*/
97110
export class AdapterError extends AuthError {
111+
/** @internal */
98112
static type = "AdapterError"
99113
}
100114

101115
/**
102116
* Thrown when the execution of the [`signIn` callback](https://authjs.dev/reference/core/types#signin) fails
103117
* or if it returns `false`.
118+
* @noInheritDoc
104119
*/
105120
export class AccessDenied extends AuthError {
121+
/** @internal */
106122
static type = "AccessDenied"
107123
}
108124

@@ -144,8 +160,10 @@ export class AccessDenied extends AuthError {
144160
* Check out `[auth][cause]` in the error message for more details.
145161
* It will show the original stack trace.
146162
* :::
163+
* @noInheritDoc
147164
*/
148165
export class CallbackRouteError extends AuthError {
166+
/** @internal */
149167
static type = "CallbackRouteError"
150168
}
151169

@@ -156,8 +174,10 @@ export class CallbackRouteError extends AuthError {
156174
* To fix this, make sure that the `error` page does not require authentication.
157175
*
158176
* Learn more at [Guide: Error pages](https://authjs.dev/guides/pages/error)
177+
* @noInheritDoc
159178
*/
160179
export class ErrorPageLoop extends AuthError {
180+
/** @internal */
161181
static type = "ErrorPageLoop"
162182
}
163183

@@ -168,8 +188,10 @@ export class ErrorPageLoop extends AuthError {
168188
* Make sure that the `events` methods are implemented correctly and uncaught errors are handled.
169189
*
170190
* Learn more at [`events`](https://authjs.dev/reference/core/types#eventcallbacks)
191+
* @noInheritDoc
171192
*/
172193
export class EventError extends AuthError {
194+
/** @internal */
173195
static type = "EventError"
174196
}
175197

@@ -182,8 +204,10 @@ export class EventError extends AuthError {
182204
* To prevent this, Auth.js checks if the callback URL is valid and throws this error if it is not.
183205
*
184206
* There is no action required, but it might be an indicator that somebody is trying to attack your application.
207+
* @noInheritDoc
185208
*/
186209
export class InvalidCallbackUrl extends AuthError {
210+
/** @internal */
187211
static type = "InvalidCallbackUrl"
188212
}
189213

@@ -192,8 +216,10 @@ export class InvalidCallbackUrl extends AuthError {
192216
* When an error occurs during the `authorize` callback, two things can happen:
193217
* 1. The user is redirected to the signin page, with `error=CredentialsSignin&code=credentials` in the URL. `code` is configurable.
194218
* 2. If you throw this error in a framework that handles form actions server-side, this error is thrown, instead of redirecting the user, so you'll need to handle.
219+
* @noInheritDoc
195220
*/
196221
export class CredentialsSignin extends SignInError {
222+
/** @internal */
197223
static type = "CredentialsSignin"
198224
/**
199225
* The error code that is set in the `code` query parameter of the redirect URL.
@@ -214,8 +240,10 @@ export class CredentialsSignin extends SignInError {
214240
* To perform OAuth or OIDC sign in, at least one of these endpoints is required.
215241
*
216242
* Learn more at [`OAuth2Config`](https://authjs.dev/reference/core/providers#oauth2configprofile) or [Guide: OAuth Provider](https://authjs.dev/guides/configuring-oauth-providers)
243+
* @noInheritDoc
217244
*/
218245
export class InvalidEndpoints extends AuthError {
246+
/** @internal */
219247
static type = "InvalidEndpoints"
220248
}
221249

@@ -224,8 +252,10 @@ export class InvalidEndpoints extends AuthError {
224252
* This could happen if the OAuth provider is configured incorrectly or if the browser is blocking cookies.
225253
*
226254
* Learn more at [`checks`](https://authjs.dev/reference/core/providers#checks)
255+
* @noInheritDoc
227256
*/
228257
export class InvalidCheck extends AuthError {
258+
/** @internal */
229259
static type = "InvalidCheck"
230260
}
231261

@@ -239,8 +269,10 @@ export class InvalidCheck extends AuthError {
239269
* :::
240270
*
241271
* Learn more at [`secret`](https://authjs.dev/reference/core#secret), [`jwt.encode`](https://authjs.dev/reference/core/jwt#encode-1) or [`jwt.decode`](https://authjs.dev/reference/core/jwt#decode-2) for more information.
272+
* @noInheritDoc
242273
*/
243274
export class JWTSessionError extends AuthError {
275+
/** @internal */
244276
static type = "JWTSessionError"
245277
}
246278

@@ -250,8 +282,10 @@ export class JWTSessionError extends AuthError {
250282
* In both cases, make sure you either remove the configuration or add the missing adapter.
251283
*
252284
* Learn more at [Database Adapters](https://authjs.dev/getting-started/database), [Email provider](https://authjs.dev/getting-started/authentication/email) or [Concept: Database session strategy](https://authjs.dev/concepts/session-strategies#database-session)
285+
* @noInheritDoc
253286
*/
254287
export class MissingAdapter extends AuthError {
288+
/** @internal */
255289
static type = "MissingAdapter"
256290
}
257291

@@ -261,8 +295,10 @@ export class MissingAdapter extends AuthError {
261295
* Make sure you either remove the configuration or add the missing methods to the adapter.
262296
*
263297
* Learn more at [Database Adapters](https://authjs.dev/getting-started/database)
298+
* @noInheritDoc
264299
*/
265300
export class MissingAdapterMethods extends AuthError {
301+
/** @internal */
266302
static type = "MissingAdapterMethods"
267303
}
268304

@@ -271,8 +307,10 @@ export class MissingAdapterMethods extends AuthError {
271307
* To perform credentials sign in, the `authorize` method is required.
272308
*
273309
* Learn more at [Credentials provider](https://authjs.dev/getting-started/authentication/credentials)
310+
* @noInheritDoc
274311
*/
275312
export class MissingAuthorize extends AuthError {
313+
/** @internal */
276314
static type = "MissingAuthorize"
277315
}
278316

@@ -288,8 +326,10 @@ export class MissingAuthorize extends AuthError {
288326
* :::tip
289327
* To generate a random string, you can use the Auth.js CLI: `npx auth secret`
290328
* :::
329+
* @noInheritDoc
291330
*/
292331
export class MissingSecret extends AuthError {
332+
/** @internal */
293333
static type = "MissingSecret"
294334
}
295335

@@ -304,8 +344,10 @@ export class MissingSecret extends AuthError {
304344
* you can enable automatic account linking by setting [`allowDangerousEmailAccountLinking: true`](https://authjs.dev/reference/core/providers#allowdangerousemailaccountlinking)
305345
* in the provider configuration.
306346
* :::
347+
* @noInheritDoc
307348
*/
308349
export class OAuthAccountNotLinked extends SignInError {
350+
/** @internal */
309351
static type = "OAuthAccountNotLinked"
310352
}
311353

@@ -314,17 +356,21 @@ export class OAuthAccountNotLinked extends SignInError {
314356
* This could happen for example if the user denied access to the application or there was a configuration error.
315357
*
316358
* For a full list of possible reasons, check out the specification [Authorization Code Grant: Error Response](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.2.1)
359+
* @noInheritDoc
317360
*/
318361
export class OAuthCallbackError extends SignInError {
362+
/** @internal */
319363
static type = "OAuthCallbackError"
320364
}
321365

322366
/**
323367
* This error occurs during an OAuth sign in attempt when the provider's
324368
* response could not be parsed. This could for example happen if the provider's API
325369
* changed, or the [`OAuth2Config.profile`](https://authjs.dev/reference/core/providers#oauth2configprofile) method is not implemented correctly.
370+
* @noInheritDoc
326371
*/
327372
export class OAuthProfileParseError extends AuthError {
373+
/** @internal */
328374
static type = "OAuthProfileParseError"
329375
}
330376

@@ -334,8 +380,10 @@ export class OAuthProfileParseError extends AuthError {
334380
* The database adapter might be misconfigured or the database is not reachable.
335381
*
336382
* Learn more at [Concept: Database session strategy](https://authjs.dev/concepts/session-strategies#database)
383+
* @noInheritDoc
337384
*/
338385
export class SessionTokenError extends AuthError {
386+
/** @internal */
339387
static type = "SessionTokenError"
340388
}
341389

@@ -353,8 +401,10 @@ export class SessionTokenError extends AuthError {
353401
* [auth][details]: { "provider": "github" }
354402
* ```
355403
* :::
404+
* @noInheritDoc
356405
*/
357406
export class OAuthSignInError extends SignInError {
407+
/** @internal */
358408
static type = "OAuthSignInError"
359409
}
360410

@@ -367,8 +417,10 @@ export class OAuthSignInError extends SignInError {
367417
* Ask the user to log in again.
368418
* - There was an error with the database:
369419
* Check the database logs.
420+
* @noInheritDoc
370421
*/
371422
export class EmailSignInError extends SignInError {
423+
/** @internal */
372424
static type = "EmailSignInError"
373425
}
374426

@@ -380,32 +432,41 @@ export class EmailSignInError extends SignInError {
380432
* process, such as emitting sign-out events or clearing session cookies.
381433
*
382434
* The session cookie(s) are emptied even if this error is logged.
383-
*
435+
* @noInheritDoc
384436
*/
385437
export class SignOutError extends AuthError {
438+
/** @internal */
386439
static type = "SignOutError"
387440
}
388441

389442
/**
390443
* Auth.js was requested to handle an operation that it does not support.
391444
*
392445
* See [`AuthAction`](https://authjs.dev/reference/core/types#authaction) for the supported actions.
446+
* @noInheritDoc
393447
*/
394448
export class UnknownAction extends AuthError {
449+
/** @internal */
395450
static type = "UnknownAction"
396451
}
397452

398453
/**
399454
* Thrown when a Credentials provider is present but the JWT strategy (`strategy: "jwt"`) is not enabled.
400455
*
401456
* Learn more at [`strategy`](https://authjs.dev/reference/core#strategy) or [Credentials provider](https://authjs.dev/getting-started/authentication/credentials)
457+
* @noInheritDoc
402458
*/
403459
export class UnsupportedStrategy extends AuthError {
460+
/** @internal */
404461
static type = "UnsupportedStrategy"
405462
}
406463

407-
/** Thrown when an endpoint was incorrectly called without a provider, or with an unsupported provider. */
464+
/**
465+
* Thrown when an endpoint was incorrectly called without a provider, or with an unsupported provider.
466+
* @noInheritDoc
467+
*/
408468
export class InvalidProvider extends AuthError {
469+
/** @internal */
409470
static type = "InvalidProvider"
410471
}
411472

@@ -419,17 +480,21 @@ export class InvalidProvider extends AuthError {
419480
* :::
420481
*
421482
* Learn more at [`trustHost`](https://authjs.dev/reference/core#trusthost) or [Guide: Deployment](https://authjs.dev/getting-started/deployment)
483+
* @noInheritDoc
422484
*/
423485
export class UntrustedHost extends AuthError {
486+
/** @internal */
424487
static type = "UntrustedHost"
425488
}
426489

427490
/**
428491
* The user's email/token combination was invalid.
429492
* This could be because the email/token combination was not found in the database,
430493
* or because the token has expired. Ask the user to log in again.
494+
* @noInheritDoc
431495
*/
432496
export class Verification extends AuthError {
497+
/** @internal */
433498
static type = "Verification"
434499
}
435500

@@ -442,8 +507,10 @@ export class Verification extends AuthError {
442507
*
443508
* Double submit cookie pattern, a CSRF defense, requires matching values in a cookie
444509
* and request parameter. More on this at [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Glossary/CSRF).
510+
* @noInheritDoc
445511
*/
446512
export class MissingCSRF extends SignInError {
513+
/** @internal */
447514
static type = "MissingCSRF"
448515
}
449516

@@ -471,24 +538,30 @@ export function isClientError(error: Error): error is AuthError {
471538
/**
472539
* Thrown when multiple providers have `enableConditionalUI` set to `true`.
473540
* Only one provider can have this option enabled at a time.
541+
* @noInheritDoc
474542
*/
475543
export class DuplicateConditionalUI extends AuthError {
544+
/** @internal */
476545
static type = "DuplicateConditionalUI"
477546
}
478547

479548
/**
480549
* Thrown when a WebAuthn provider has `enableConditionalUI` set to `true` but no formField has `webauthn` in its autocomplete param.
481550
*
482551
* The `webauthn` autocomplete param is required for conditional UI to work.
552+
* @noInheritDoc
483553
*/
484554
export class MissingWebAuthnAutocomplete extends AuthError {
555+
/** @internal */
485556
static type = "MissingWebAuthnAutocomplete"
486557
}
487558

488559
/**
489560
* Thrown when a WebAuthn provider fails to verify a client response.
561+
* @noInheritDoc
490562
*/
491563
export class WebAuthnVerificationError extends AuthError {
564+
/** @internal */
492565
static type = "WebAuthnVerificationError"
493566
}
494567

@@ -497,14 +570,18 @@ export class WebAuthnVerificationError extends AuthError {
497570
* but the user is trying an account that is not linked to it.
498571
*
499572
* For security reasons, Auth.js does not automatically link accounts to existing accounts if the user is not signed in.
573+
* @noInheritDoc
500574
*/
501575
export class AccountNotLinked extends SignInError {
576+
/** @internal */
502577
static type = "AccountNotLinked"
503578
}
504579

505580
/**
506581
* Thrown when an experimental feature is used but not enabled.
582+
* @noInheritDoc
507583
*/
508584
export class ExperimentalFeatureNotEnabled extends AuthError {
585+
/** @internal */
509586
static type = "ExperimentalFeatureNotEnabled"
510587
}

‎packages/core/src/lib/utils/assert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from "../../errors.js"
1616

1717
import type { RequestInternal, SemverString } from "../../types.js"
18-
import type { WarningCode } from "./logger.js"
18+
import type { WarningCode } from "../../warnings.js"
1919
import { Adapter } from "../../adapters.js"
2020
import type { AuthConfig } from "../../index.js"
2121

‎packages/core/src/lib/utils/logger.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
import { AuthError } from "../../errors.js"
2+
import type { WarningCode } from "../../warnings.js"
23
import type { AuthConfig } from "../../index.js"
34

4-
export type WarningCode =
5-
| "debug-enabled"
6-
| "csrf-disabled"
7-
| "experimental-webauthn"
8-
| "env-url-basepath-redundant"
9-
| "env-url-basepath-mismatch"
10-
115
/**
126
* Override any of the methods, and the rest will use the default logger.
137
*
@@ -47,7 +41,7 @@ const defaultLogger: LoggerInstance = {
4741
}
4842
},
4943
warn(code) {
50-
const url = `https://warnings.authjs.dev#${code}`
44+
const url = `https://warnings.authjs.dev`
5145
console.warn(`${yellow}[auth][warn][${code}]${reset}`, `Read more: ${url}`)
5246
},
5347
debug(message, metadata) {

‎packages/core/src/providers/frontegg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export interface FronteggProfile {
6363
*
6464
* Log into the [Frontegg portal](https://portal.frontegg.com)
6565
*
66-
* Authentication > Login method > Hosted login > Add your callback url here <{{APP_URL}}/api/auth/callback/frontegg>
66+
* Authentication > Login method > Hosted login > Add your callback url here
6767
*
6868
* Then, create a `.env.local` file in the project root add the following entries:
6969
*

‎packages/core/src/providers/logto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface LogtoProfile {
4343
organizations: string[]
4444
/** The organization data the user belongs to */
4545
organization_data: object[]
46-
/** The organization roles the user belongs to with the format of <organization_id>:<role_name> */
46+
/** The organization roles the user belongs to with the format of organization_id:/role_name */
4747
organization_roles: string[]
4848
/** The user's custom attributes */
4949
[claim: string]: unknown

‎packages/core/src/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import { AuthConfig } from "./index.js"
5858
import type { JWTOptions } from "./jwt.js"
5959
import type { Cookie } from "./lib/utils/cookie.js"
6060
import type { LoggerInstance } from "./lib/utils/logger.js"
61+
import type { WarningCode } from "./warnings.js"
6162
import type {
6263
CredentialsConfig,
6364
EmailConfig,
@@ -72,7 +73,7 @@ import type {
7273

7374
export type { WebAuthnOptionsResponseBody } from "./lib/utils/webauthn-utils.js"
7475
export type { AuthConfig } from "./index.js"
75-
export type { LoggerInstance }
76+
export type { LoggerInstance, WarningCode }
7677
export type Awaitable<T> = T | PromiseLike<T>
7778
export type Awaited<T> = T extends Promise<infer U> ? U : T
7879

‎packages/core/src/warnings.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* - `debug-enabled`: The `debug` option was evaluated to `true`. It adds extra logs in the terminal which is useful in development,
3+
* but since it can print sensitive information about users, make sure to set this to `false` in production.
4+
* In Node.js environments, you can for example set `debug: process.env.NODE_ENV !== "production"`.
5+
* Consult with your runtime/framework on how to set this value correctly.
6+
* - `csrf-disabled`: You were trying to get a CSRF response from Auth.js (eg.: by calling a `/csrf` endpoint),
7+
* but in this setup, CSRF protection via Auth.js was turned off. This is likely if you are not directly using `@auth/core`
8+
* but a framework library (like `@auth/sveltekit`) that already has CSRF protection built-in. You likely won't need the CSRF response.
9+
* - `env-url-basepath-redundant`: `AUTH_URL` (or `NEXTAUTH_URL`) and `authConfig.basePath` are both declared. This is a configuration mistake - you should either remove the `authConfig.basePath` configuration,
10+
* or remove the `pathname` of `AUTH_URL` (or `NEXTAUTH_URL`). Only one of them is needed.
11+
* - `env-url-basepath-mismatch`: `AUTH_URL` (or `NEXTAUTH_URL`) and `authConfig.basePath` are both declared, but they don't match. This is a configuration mistake.
12+
* `@auth/core` will use `basePath` to construct the full URL to the corresponding action (/signin, /signout, etc.) in this case.
13+
* - `experimental-webauthn`: Experimental WebAuthn feature is enabled.
14+
*
15+
*/
16+
export type WarningCode =
17+
| "debug-enabled"
18+
| "csrf-disabled"
19+
| "env-url-basepath-redundant"
20+
| "env-url-basepath-mismatch"
21+
| "experimental-webauthn"

‎pnpm-lock.yaml

Lines changed: 111 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎turbo.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,14 @@
7070
"@auth/qwik#build"
7171
],
7272
"persistent": true,
73-
"cache": false
73+
"cache": false,
74+
"outputs": [
75+
".next/**/*",
76+
"build/**/*",
77+
"!.next/cache/**",
78+
"docs/reference/**/*.mdx",
79+
"docs/reference/*.mdx"
80+
]
7481
},
7582
"docs#build": {
7683
"inputs": [
@@ -117,9 +124,11 @@
117124
],
118125
"outputs": [
119126
".next/**/*",
127+
"build/**/*",
120128
"!.next/cache/**",
121-
"docs/reference/**",
122-
"!docs/reference/_meta.js"
129+
"docs/reference/**/*.mdx",
130+
"docs/reference/**/*.js",
131+
"docs/reference/*.mdx"
123132
]
124133
}
125134
}

0 commit comments

Comments
 (0)
Please sign in to comment.