Skip to content

Commit 492e953

Browse files
committed
Merge branch 'feat/add-a12n1' of github.com:curveball/next-auth into feat/add-a12n1
2 parents f19f8ae + 3f3ad2f commit 492e953

File tree

77 files changed

+661
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+661
-355
lines changed

.gitignore

+1
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

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
> [!NOTE]
2+
> The Auth.js/NextAuth.js project is not provided by, nor otherwise affiliated with Vercel Inc. or its subsidiaries. Any contributions to this project by individuals affiliated with Vercel are made in their personal capacity.
3+
14
<p align="center">
25
<br/>
36
<a href="https://authjs.dev" target="_blank"><img width="96px" src="https://authjs.dev/img/logo-sm.png" /></a>
@@ -10,7 +13,7 @@
1013
<a href="https://github.com/nextauthjs/next-auth/releases"><img src="https://img.shields.io/npm/v/next-auth/beta?style=flat-square&label=latest%20NextAuth.js v5" alt="NPM next-auth@beta release" /></a>
1114
<!-- TODO: Should count `@auth/core` when NextAuth.js v5 is released as stable. -->
1215
<a href="https://www.npmtrends.com/next-auth"><img src="https://img.shields.io/npm/dm/next-auth?style=flat-square&color=cyan" alt="Downloads" /></a>
13-
<a href="https://github.com/nextauthjs/next-auth/stargazers"><img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square&color=orange" alt="Github Stars" /></a>
16+
<a href="https://github.com/nextauthjs/next-auth/stargazers"><img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square&color=orange" alt="GitHub Stars" /></a>
1417
<!-- <a href="https://codecov.io/gh/nextauthjs/next-auth" ><img alt="Codecov" src="https://img.shields.io/codecov/c/github/nextauthjs/next-auth?token=o2KN5GrPsY&style=flat-square&logo=codecov"></a> -->
1518
<img src="https://shields.io/badge/TypeScript-3178C6?logo=TypeScript&logoColor=fff&style=flat-square" alt="TypeScript" />
1619
</p>

apps/dev/qwik/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pnpm preview # or `pnpm preview`
5858

5959
## Production
6060

61-
The production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.
61+
The production build will generate client and server modules by running both client and server build commands. The build command will use TypeScript to run a type check on the source code.
6262

6363
```shell
6464
pnpm build # or `pnpm build`

apps/examples/qwik/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pnpm preview # or `pnpm preview`
5858

5959
## Production
6060

61-
The production build will generate client and server modules by running both client and server build commands. The build command will use Typescript to run a type check on the source code.
61+
The production build will generate client and server modules by running both client and server build commands. The build command will use TypeScript to run a type check on the source code.
6262

6363
```shell
6464
pnpm build # or `pnpm build`

apps/examples/qwik/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"typescript": "5.4.5",
4646
"undici": "*",
4747
"vercel": "^29.1.1",
48-
"vite": "^5.2.10",
48+
"vite": "^5.4.12",
4949
"vite-tsconfig-paths": "^4.2.1"
5050
}
5151
}

apps/examples/solid-start/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"solid-start-vercel": "^0.2.9",
1515
"tailwindcss": "^3.2.4",
1616
"typescript": "5.2.2",
17-
"vite": "^3.1.0"
17+
"vite": "^4.5.6"
1818
},
1919
"dependencies": {
2020
"@auth/solid-start": "latest",

docs/components/OAuthProviderInstructions/content/components/SetupCode.tsx

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { Pre, Code as NXCode } from "nextra/components"
33
import { TSIcon } from "./TSIcon"
44

55
interface Props {
6-
providerName: string
6+
providerSymbol: string
77
providerId: string
88
highlight: (code: string) => string
99
}
1010

11-
export function SetupCode({ providerId, providerName, highlight }: Props) {
11+
export function SetupCode({ providerId, providerSymbol, highlight }: Props) {
1212
return (
1313
<Code>
1414
<Code.Next>
@@ -25,10 +25,10 @@ export function SetupCode({ providerId, providerName, highlight }: Props) {
2525
dangerouslySetInnerHTML={{
2626
__html: highlight(`
2727
import NextAuth from "next-auth"
28-
import ${providerName} from "next-auth/providers/${providerId}"
28+
import ${providerSymbol} from "next-auth/providers/${providerId}"
2929
3030
export const { handlers, signIn, signOut, auth } = NextAuth({
31-
providers: [${providerName}],
31+
providers: [${providerSymbol}],
3232
})`),
3333
}}
3434
/>
@@ -64,10 +64,10 @@ export const { GET, POST } = handlers
6464
dangerouslySetInnerHTML={{
6565
__html: highlight(`
6666
import { QwikAuth$ } from "@auth/qwik"
67-
import ${providerName} from "@auth/qwik/providers/${providerId}"
67+
import ${providerSymbol} from "@auth/qwik/providers/${providerId}"
6868
6969
export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$({
70-
providers: [${providerName}],
70+
providers: [${providerSymbol}],
7171
}) `),
7272
}}
7373
/>
@@ -86,10 +86,10 @@ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$({
8686
dangerouslySetInnerHTML={{
8787
__html: highlight(`
8888
import { SvelteKitAuth } from "@auth/sveltekit"
89-
import ${providerName} from "@auth/sveltekit/providers/${providerId}"
89+
import ${providerSymbol} from "@auth/sveltekit/providers/${providerId}"
9090
9191
export const { handle, signIn } = SvelteKitAuth({
92-
providers: [${providerName}],
92+
providers: [${providerSymbol}],
9393
}) `),
9494
}}
9595
/>
@@ -145,14 +145,14 @@ export const load: LayoutServerLoad = async (event) => {
145145
dangerouslySetInnerHTML={{
146146
__html: highlight(`
147147
import { ExpressAuth } from "@auth/express"
148-
import ${providerName} from "@auth/express/providers/${providerId}"
148+
import ${providerSymbol} from "@auth/express/providers/${providerId}"
149149
import express from "express"
150150
151151
const app = express()
152152
153153
// If app is served through a proxy, trust the proxy to allow HTTPS protocol to be detected
154154
app.set('trust proxy', true)
155-
app.use("/auth/*", ExpressAuth({ providers: [ ${providerName} ] }))
155+
app.use("/auth/*", ExpressAuth({ providers: [ ${providerSymbol} ] }))
156156
`),
157157
}}
158158
/>

docs/components/OAuthProviderInstructions/content/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function OAuthInstructions({ providerId, disabled = false }: Props) {
3838
}
3939

4040
const providerName = manifest.providersOAuth[providerId]
41+
const providerSymbol = providerName.replace(/\s+/g, "")
4142
const envVars = [
4243
`AUTH_${providerId.toUpperCase().replace(/-/gi, "_")}_ID={CLIENT_ID}`,
4344
`AUTH_${providerId.toUpperCase().replace(/-/gi, "_")}_SECRET={CLIENT_SECRET}`,
@@ -205,7 +206,7 @@ export function OAuthInstructions({ providerId, disabled = false }: Props) {
205206
</p>
206207
<SetupCode
207208
providerId={providerId}
208-
providerName={providerName}
209+
providerSymbol={providerSymbol}
209210
highlight={highlight}
210211
/>
211212
{/* Step 4 */}

docs/next.config.js

+1-1
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

+6-4
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/getting-started/adapters/dynamodb.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ app.set("trust proxy", true)
161161
app.use(
162162
"/auth/*",
163163
ExpressAuth({
164-
providers: []
164+
providers: [],
165165
adapter: DynamoDBAdapter(client),
166166
})
167167
)

docs/pages/getting-started/providers/microsoft-entra-id.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ In `.env.local` create the following entries:
161161
```
162162
AUTH_MICROSOFT_ENTRA_ID_ID=<copy Application (client) ID here>
163163
AUTH_MICROSOFT_ENTRA_ID_SECRET=<copy generated client secret value here>
164-
AUTH_MICROSOFT_ENTRA_ID_ISSUER=<copy the issuer here>
164+
AUTH_MICROSOFT_ENTRA_ID_ISSUER=https://login.microsoftonline.com/<copy the issuer here>/v2.0
165165
```
166166

167167
That will default the tenant to use the `common` authorization endpoint. [For more details see here](https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols#endpoints).

docs/pages/getting-started/providers/postmark.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ If someone provides the email address of an _existing account_ when signing in,
2727

2828
## Configuration
2929

30-
1. First, you'll need to [add your domain](https://postmark.com/domains) to your Postmark account. This is required by Postmark and this domain of the address you use in the `from` provider option.
30+
1. First, you'll need to [add your domain](https://account.postmarkapp.com/sign_up) to your Postmark account. This is required by Postmark and this domain of the address you use in the `from` provider option.
3131

32-
2. Next, you will have to generate an API key in the [Postmark Dashboard](https://postmark.com/api-keys). You can save this API key as the `AUTH_POSTMARK_KEY` environment variable.
32+
2. Next, you will have to generate an API key in the [Postmark Dashboard](https://account.postmarkapp.com/api_tokens). You can save this API key as the `AUTH_POSTMARK_KEY` environment variable.
3333

3434
```sh
3535
AUTH_POSTMARK_KEY=abc

docs/pages/getting-started/session-management/get-session.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,8 @@ app.get("/", (req, res) => {
205205
</Code>
206206

207207
If you'd like to extend your session with more fields from your OAuth provider, for example, please check out our ["extending the session" guide](/guides/extending-the-session).
208+
209+
<Callout>
210+
By default, GET requests to the session endpoint will automatically return the
211+
headers to prevent caching.
212+
</Callout>

docs/pages/reference/_meta.js

+1-5
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

-23
This file was deleted.
Loading

docs/typedoc-nextauth.cjs docs/typedoc-nextauth.js

+13-9
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

+3-5
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-azure-tables/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@auth/azure-tables-adapter",
3-
"version": "1.7.4",
3+
"version": "1.8.0",
44
"description": "Azure Tables Storage adapter for next-auth.",
55
"homepage": "https://authjs.dev",
66
"repository": "https://github.com/nextauthjs/next-auth",

packages/adapter-d1/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@auth/d1-adapter",
3-
"version": "1.7.4",
3+
"version": "1.8.0",
44
"description": "A Cloudflare D1 adapter for Auth.js",
55
"homepage": "https://authjs.dev",
66
"repository": "https://github.com/nextauthjs/next-auth",

packages/adapter-dgraph/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@auth/dgraph-adapter",
3-
"version": "2.7.4",
3+
"version": "2.8.0",
44
"description": "Dgraph adapter for Auth.js",
55
"homepage": "https://authjs.dev",
66
"repository": "https://github.com/nextauthjs/next-auth",

packages/adapter-drizzle/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@auth/drizzle-adapter",
3-
"version": "1.7.4",
3+
"version": "1.8.0",
44
"description": "Drizzle adapter for Auth.js.",
55
"homepage": "https://authjs.dev",
66
"repository": "https://github.com/nextauthjs/next-auth",

packages/adapter-dynamodb/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@auth/dynamodb-adapter",
33
"repository": "https://github.com/nextauthjs/next-auth",
4-
"version": "2.7.4",
4+
"version": "2.8.0",
55
"description": "AWS DynamoDB adapter for next-auth.",
66
"keywords": [
77
"next-auth",

0 commit comments

Comments
 (0)