Skip to content

Commit

Permalink
Merge branch 'main' into fix/tabs-url-param
Browse files Browse the repository at this point in the history
  • Loading branch information
diedu89 authored Feb 13, 2025
2 parents 9ee89ef + 4234129 commit 258015f
Show file tree
Hide file tree
Showing 16 changed files with 88 additions and 253 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ packages/next-auth/providers
# copied from @auth/core
packages/frameworks-*/**/providers
packages/*/*.js
!packages/*/typedoc.config.js
packages/*/*.d.ts
packages/*/*.d.ts.map
packages/*/lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Pre, Code as NXCode } from "nextra/components"
import { TSIcon } from "./TSIcon"

interface Props {
providerName: string
providerSymbol: string
providerId: string
highlight: (code: string) => string
}

export function SetupCode({ providerId, providerName, highlight }: Props) {
export function SetupCode({ providerId, providerSymbol, highlight }: Props) {
return (
<Code>
<Code.Next>
Expand All @@ -25,10 +25,10 @@ export function SetupCode({ providerId, providerName, highlight }: Props) {
dangerouslySetInnerHTML={{
__html: highlight(`
import NextAuth from "next-auth"
import ${providerName} from "next-auth/providers/${providerId}"
import ${providerSymbol} from "next-auth/providers/${providerId}"
export const { handlers, signIn, signOut, auth } = NextAuth({
providers: [${providerName}],
providers: [${providerSymbol}],
})`),
}}
/>
Expand Down Expand Up @@ -64,10 +64,10 @@ export const { GET, POST } = handlers
dangerouslySetInnerHTML={{
__html: highlight(`
import { QwikAuth$ } from "@auth/qwik"
import ${providerName} from "@auth/qwik/providers/${providerId}"
import ${providerSymbol} from "@auth/qwik/providers/${providerId}"
export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$({
providers: [${providerName}],
providers: [${providerSymbol}],
}) `),
}}
/>
Expand All @@ -86,10 +86,10 @@ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$({
dangerouslySetInnerHTML={{
__html: highlight(`
import { SvelteKitAuth } from "@auth/sveltekit"
import ${providerName} from "@auth/sveltekit/providers/${providerId}"
import ${providerSymbol} from "@auth/sveltekit/providers/${providerId}"
export const { handle, signIn } = SvelteKitAuth({
providers: [${providerName}],
providers: [${providerSymbol}],
}) `),
}}
/>
Expand Down Expand Up @@ -145,14 +145,14 @@ export const load: LayoutServerLoad = async (event) => {
dangerouslySetInnerHTML={{
__html: highlight(`
import { ExpressAuth } from "@auth/express"
import ${providerName} from "@auth/express/providers/${providerId}"
import ${providerSymbol} from "@auth/express/providers/${providerId}"
import express from "express"
const app = express()
// If app is served through a proxy, trust the proxy to allow HTTPS protocol to be detected
app.set('trust proxy', true)
app.use("/auth/*", ExpressAuth({ providers: [ ${providerName} ] }))
app.use("/auth/*", ExpressAuth({ providers: [ ${providerSymbol} ] }))
`),
}}
/>
Expand Down
3 changes: 2 additions & 1 deletion docs/components/OAuthProviderInstructions/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export function OAuthInstructions({ providerId, disabled = false }: Props) {
}

const providerName = manifest.providersOAuth[providerId]
const providerSymbol = providerName.replace(/\s+/g, "")
const envVars = [
`AUTH_${providerId.toUpperCase().replace(/-/gi, "_")}_ID={CLIENT_ID}`,
`AUTH_${providerId.toUpperCase().replace(/-/gi, "_")}_SECRET={CLIENT_SECRET}`,
Expand Down Expand Up @@ -205,7 +206,7 @@ export function OAuthInstructions({ providerId, disabled = false }: Props) {
</p>
<SetupCode
providerId={providerId}
providerName={providerName}
providerSymbol={providerSymbol}
highlight={highlight}
/>
{/* Step 4 */}
Expand Down
7 changes: 3 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@
"postcss": "^8.4.47",
"shiki": "^1.22.0",
"tailwindcss": "^3.4.13",
"typedoc": "^0.27.6",
"typedoc-plugin-markdown": "4.4.1",
"typedoc-plugin-mdn-links": "4.0.11",
"typedoc-plugin-no-inherit": "^1.5.0"
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "4.0.0-next.54",
"typedoc-plugin-mdn-links": "^3.3.2"
}
}
4 changes: 2 additions & 2 deletions docs/pages/getting-started/providers/postmark.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ If someone provides the email address of an _existing account_ when signing in,

## Configuration

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.
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.

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.
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.

```sh
AUTH_POSTMARK_KEY=abc
Expand Down
8 changes: 4 additions & 4 deletions docs/typedoc-nextauth.js → docs/typedoc-nextauth.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// @ts-check

import { MarkdownPageEvent } from "typedoc-plugin-markdown"
import path from "path"
import fs from "fs"
const { MarkdownPageEvent } = require("typedoc-plugin-markdown")
const path = require("path")
const fs = require("fs")

/**
* Local plugin to tweak TypeDoc output for nextra docs
*
* @param {import("typedoc-plugin-markdown").MarkdownApplication} app
*/
export function load(app) {
module.exports.load = (app) => {
injectNextraCalloutImport(app)
parseOutput(app)
writeMetaJsFiles(app)
Expand Down
4 changes: 1 addition & 3 deletions docs/typedoc.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,15 @@ module.exports = {
tsconfig: "./tsconfig.json",
plugin: [
"typedoc-plugin-markdown",
require.resolve("./typedoc-nextauth.js"),
require.resolve("./typedoc-nextauth.cjs"),
"typedoc-plugin-mdn-links",
"typedoc-plugin-no-inherit",
],
disableSources: true,
excludeNotDocumented: true,
excludeExternals: true,
excludeInternal: true,
excludePrivate: true,
excludeProtected: true,
excludeReferences: true,
cleanOutputDir: false,
gitRevision: "main",
githubPages: false,
Expand Down
6 changes: 3 additions & 3 deletions packages/adapter-kysely/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
* <div style={{display: "flex", justifyContent: "space-between", alignItems: "center", padding: 16}}>
* <p>Official <a href="https://kysely.dev/">Kysely</a> adapter for Auth.js / NextAuth.js.</p>
* <a href="https://kysely.dev/">
* <img style={{display: "block"}} src="https://authjs.dev/img/adapters/kysely.svg" width="30" />
* <img style={{display: "block"}} src="/img/adapters/kysely.svg" width="38" />
* </a>
* </div>
*
* ## Installation
*
* ```bash npm2yarn
* npm install @auth/kysely-adapter kysely
* npm install kysely @auth/kysely-adapter
* ```
*
* @module @auth/kysely-adapter
*/

import { Kysely, SqliteAdapter } from "kysely"

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

Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-mongodb/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface MongoDBAdapterOptions {
databaseName?: string
/**
* Callback function for managing the closing of the MongoDB client.
* This could be useful when `client` is provided as a function returning MongoClient.
* This could be useful when `client` is provided as a function returning MongoClient | Promise<MongoClient>.
* It allows for more customized management of database connections,
* addressing persistence, container reuse, and connection closure issues.
*/
Expand Down Expand Up @@ -115,7 +115,7 @@ export function MongoDBAdapter(
* - A promise that resolves to a connected `MongoClient` (not recommended).
* - A function, to handle more complex and custom connection strategies.
*
* 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.
* 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.
*/
client:
| MongoClient
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"access": "public"
},
"scripts": {
"clean": "rm ./prisma/dev.db* || echo 'File deleted' && rm -rf index.js *.d.ts*",
"clean": "rm ./prisma/dev.db* || echo 'File deleted' && rm -rf *.js *.d.ts*",
"init:default": "prisma migrate dev --name init --skip-seed",
"init:custom": "prisma migrate dev --name init-custom --schema ./prisma/custom.prisma",
"test:default": "pnpm init:default && vitest run -c ../utils/vitest.config.ts",
Expand Down
18 changes: 18 additions & 0 deletions packages/adapter-prisma/typedoc.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// @ts-check

/**
* @type {import('typedoc').TypeDocOptions & import('typedoc-plugin-markdown').PluginOptions}
*/
module.exports = {
entryPoints: ["src/index.ts"],
entryPointStrategy: "expand",
tsconfig: "./tsconfig.json",
plugin: [
require.resolve("./../../docs/typedoc-nextauth.cjs"),
"typedoc-plugin-markdown",
],
entryFileName: "../prisma-adapter.mdx",
entryModule: "@auth/prisma-adapter",
includeVersion: true,
readme: 'none'
}
8 changes: 0 additions & 8 deletions packages/adapter-prisma/typedoc.config.js

This file was deleted.

Loading

0 comments on commit 258015f

Please sign in to comment.