mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Compare commits
11 Commits
@auth/soli
...
docs/api-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
354b03471c | ||
|
|
0a7286e857 | ||
|
|
cf544d6ec7 | ||
|
|
84e14d76b3 | ||
|
|
7794b6dfbb | ||
|
|
d195381224 | ||
|
|
b3d5ec596b | ||
|
|
34f8f36038 | ||
|
|
a79a5d6cbe | ||
|
|
cac71774a6 | ||
|
|
7376f10cac |
@@ -23,8 +23,8 @@ pnpm-lock.yaml
|
|||||||
|
|
||||||
.docusaurus
|
.docusaurus
|
||||||
build
|
build
|
||||||
docs/docs/reference/03-core
|
docs/docs/reference/core
|
||||||
docs/docs/reference/04-sveltekit
|
docs/docs/reference/sveltekit
|
||||||
static
|
static
|
||||||
|
|
||||||
# --------------- Packages ---------------
|
# --------------- Packages ---------------
|
||||||
|
|||||||
13
.gitignore
vendored
13
.gitignore
vendored
@@ -34,13 +34,10 @@ packages/next-auth/utils
|
|||||||
packages/next-auth/core
|
packages/next-auth/core
|
||||||
packages/next-auth/jwt
|
packages/next-auth/jwt
|
||||||
packages/next-auth/react
|
packages/next-auth/react
|
||||||
packages/next-auth/adapters.d.ts
|
|
||||||
packages/next-auth/adapters.js
|
|
||||||
packages/next-auth/index.d.ts
|
|
||||||
packages/next-auth/index.js
|
|
||||||
packages/next-auth/next
|
packages/next-auth/next
|
||||||
packages/next-auth/middleware.d.ts
|
packages/*/*.js
|
||||||
packages/next-auth/middleware.js
|
packages/*/*.d.ts
|
||||||
|
packages/*/*.d.ts.map
|
||||||
|
|
||||||
# Development app
|
# Development app
|
||||||
apps/dev/src/css
|
apps/dev/src/css
|
||||||
@@ -88,8 +85,8 @@ packages/core/src/providers/oauth-types.ts
|
|||||||
packages/core/lib
|
packages/core/lib
|
||||||
packages/core/providers
|
packages/core/providers
|
||||||
packages/core/src/lib/pages/styles.ts
|
packages/core/src/lib/pages/styles.ts
|
||||||
docs/docs/reference/03-core
|
docs/docs/reference/core
|
||||||
docs/docs/reference/04-sveltekit
|
docs/docs/reference/sveltekit
|
||||||
|
|
||||||
|
|
||||||
# SvelteKit
|
# SvelteKit
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ pnpm-lock.yaml
|
|||||||
|
|
||||||
.docusaurus
|
.docusaurus
|
||||||
build
|
build
|
||||||
docs/docs/reference/03-core
|
docs/docs/reference/core
|
||||||
docs/docs/reference/04-sveltekit
|
docs/docs/reference/sveltekit
|
||||||
static
|
static
|
||||||
docs/providers.json
|
docs/providers.json
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,10 @@
|
|||||||
"name": "playground-nuxt",
|
"name": "playground-nuxt",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "nuxt build",
|
"build": "nuxt prepare && nuxt build",
|
||||||
"dev": "export NODE_OPTIONS='--no-experimental-fetch' && nuxt dev",
|
"dev": "nuxt prepare && export NODE_OPTIONS='--no-experimental-fetch' && nuxt dev",
|
||||||
"generate": "nuxt generate",
|
"generate": "nuxt generate",
|
||||||
"preview": "nuxt preview",
|
"preview": "nuxt preview"
|
||||||
"postinstall": "nuxt prepare"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nuxt/eslint-config": "^0.1.1",
|
"@nuxt/eslint-config": "^0.1.1",
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Using a JWT to store the `refresh_token` is less secure than saving it in a data
|
|||||||
|
|
||||||
#### JWT strategy
|
#### JWT strategy
|
||||||
|
|
||||||
Using the [jwt](../../reference/03-core/interfaces/types.CallbacksOptions.md#jwt) and [session](../../reference/03-core/interfaces/types.CallbacksOptions.md#session) callbacks, we can persist OAuth tokens and refresh them when they expire.
|
Using the [jwt](../../reference/core/interfaces/types.CallbacksOptions.md#jwt) and [session](../../reference/core/interfaces/types.CallbacksOptions.md#session) callbacks, we can persist OAuth tokens and refresh them when they expire.
|
||||||
|
|
||||||
Below is a sample implementation using Google's Identity Provider. Please note that the OAuth 2.0 request in the `refreshAccessToken()` function will vary between different providers, but the core logic should remain similar.
|
Below is a sample implementation using Google's Identity Provider. Please note that the OAuth 2.0 request in the `refreshAccessToken()` function will vary between different providers, but the core logic should remain similar.
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
---
|
|
||||||
title: Overview
|
|
||||||
sidebar_label: Overview
|
|
||||||
sidebar_position: 0
|
|
||||||
---
|
|
||||||
|
|
||||||
## Core
|
|
||||||
|
|
||||||
## Providers
|
|
||||||
|
|
||||||
- OAuth/OIDC
|
|
||||||
- Email/Passwordless
|
|
||||||
- Credentials
|
|
||||||
|
|
||||||
## Database Adapters
|
|
||||||
|
|
||||||
## Frameworks
|
|
||||||
|
|
||||||
- Next.js
|
|
||||||
- SvelteKit
|
|
||||||
- SolidStart
|
|
||||||
- Remix
|
|
||||||
- Nuxt
|
|
||||||
- Gatsby
|
|
||||||
- etc.
|
|
||||||
@@ -62,7 +62,7 @@ const docusaurusConfig = {
|
|||||||
position: "left",
|
position: "left",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
to: "/reference/core/modules/main",
|
to: "/reference/core",
|
||||||
// TODO: change to this when the overview page looks better.
|
// TODO: change to this when the overview page looks better.
|
||||||
// to: "/reference",
|
// to: "/reference",
|
||||||
activeBasePath: "/reference",
|
activeBasePath: "/reference",
|
||||||
@@ -101,7 +101,7 @@ const docusaurusConfig = {
|
|||||||
announcementBar: {
|
announcementBar: {
|
||||||
id: "new-major-announcement",
|
id: "new-major-announcement",
|
||||||
content:
|
content:
|
||||||
"<a target='_blank' rel='noopener noreferrer' href='https://next-auth.js.org'>NextAuth.js</a> is becoming Auth.js! 🎉 We're creating Authentication for the Web. Everyone included. Starting with SvelteKit, check out <a href='/reference/sveltekit'>the docs</a>.",
|
"<a target='_blank' rel='noopener noreferrer' href='https://next-auth.js.org'>NextAuth.js</a> is becoming Auth.js! 🎉 We're creating Authentication for the Web. Everyone included. Starting with SvelteKit, check out <a href='/reference/sveltekit'>the docs</a>. Note, this site is under active development.",
|
||||||
backgroundColor: "#000",
|
backgroundColor: "#000",
|
||||||
textColor: "#fff",
|
textColor: "#fff",
|
||||||
},
|
},
|
||||||
@@ -182,10 +182,7 @@ const docusaurusConfig = {
|
|||||||
lastVersion: "current",
|
lastVersion: "current",
|
||||||
showLastUpdateAuthor: true,
|
showLastUpdateAuthor: true,
|
||||||
showLastUpdateTime: true,
|
showLastUpdateTime: true,
|
||||||
remarkPlugins: [
|
remarkPlugins: [require("@sapphire/docusaurus-plugin-npm2yarn2pnpm").npm2yarn2pnpm],
|
||||||
require("@sapphire/docusaurus-plugin-npm2yarn2pnpm").npm2yarn2pnpm,
|
|
||||||
require("remark-github"),
|
|
||||||
],
|
|
||||||
versions: {
|
versions: {
|
||||||
current: {
|
current: {
|
||||||
label: "experimental",
|
label: "experimental",
|
||||||
@@ -204,20 +201,14 @@ const docusaurusConfig = {
|
|||||||
{
|
{
|
||||||
...typedocConfig,
|
...typedocConfig,
|
||||||
id: "core",
|
id: "core",
|
||||||
plugin: ["./tyepdoc"],
|
plugin: [require.resolve("./typedoc-mdn-links")],
|
||||||
entryPoints: [
|
|
||||||
"index.ts",
|
|
||||||
"adapters.ts",
|
|
||||||
"errors.ts",
|
|
||||||
"jwt.ts",
|
|
||||||
"types.ts",
|
|
||||||
]
|
|
||||||
.map((e) => `${coreSrc}/${e}`)
|
|
||||||
.concat(providers),
|
|
||||||
tsconfig: "../packages/core/tsconfig.json",
|
|
||||||
out: "reference/03-core",
|
|
||||||
watch: process.env.TYPEDOC_WATCH,
|
watch: process.env.TYPEDOC_WATCH,
|
||||||
includeExtension: false,
|
entryPoints: ["index.ts", "adapters.ts", "errors.ts", "jwt.ts", "types.ts"].map((e) => `${coreSrc}/${e}`).concat(providers),
|
||||||
|
tsconfig: "../packages/core/tsconfig.json",
|
||||||
|
out: "reference/core",
|
||||||
|
sidebar: {
|
||||||
|
indexLabel: "index",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -225,14 +216,14 @@ const docusaurusConfig = {
|
|||||||
{
|
{
|
||||||
...typedocConfig,
|
...typedocConfig,
|
||||||
id: "sveltekit",
|
id: "sveltekit",
|
||||||
plugin: ["./tyepdoc"],
|
plugin: [require.resolve("./typedoc-mdn-links")],
|
||||||
entryPoints: ["index.ts", "client.ts"].map(
|
|
||||||
(e) => `../packages/frameworks-sveltekit/src/lib/${e}`
|
|
||||||
),
|
|
||||||
tsconfig: "../packages/frameworks-sveltekit/tsconfig.json",
|
|
||||||
out: "reference/04-sveltekit",
|
|
||||||
watch: process.env.TYPEDOC_WATCH,
|
watch: process.env.TYPEDOC_WATCH,
|
||||||
includeExtension: false,
|
entryPoints: ["index.ts", "client.ts"].map((e) => `../packages/frameworks-sveltekit/src/lib/${e}`),
|
||||||
|
tsconfig: "../packages/frameworks-sveltekit/tsconfig.json",
|
||||||
|
out: "reference/sveltekit",
|
||||||
|
sidebar: {
|
||||||
|
indexLabel: "index",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"repository": "https://github.com/nextauthjs/next-auth",
|
"repository": "https://github.com/nextauthjs/next-auth",
|
||||||
"name": "docs",
|
"name": "docs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "TYPEDOC_WATCH=true docusaurus start --no-open --port 8000",
|
"start": "TYPEDOC_WATCH=true docusaurus start --no-open",
|
||||||
"dev": "pnpm providers && pnpm snippets && pnpm start",
|
"dev": "pnpm providers && pnpm snippets && pnpm start",
|
||||||
"build": "pnpm providers && docusaurus build",
|
"build": "pnpm providers && docusaurus build",
|
||||||
"docusaurus": "docusaurus",
|
"docusaurus": "docusaurus",
|
||||||
@@ -27,7 +27,6 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-marquee-slider": "^1.1.5",
|
"react-marquee-slider": "^1.1.5",
|
||||||
"remark-github": "10.1.0",
|
|
||||||
"styled-components": "5.3.6"
|
"styled-components": "5.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -37,7 +36,9 @@
|
|||||||
"@docusaurus/preset-classic": "2.2.0",
|
"@docusaurus/preset-classic": "2.2.0",
|
||||||
"@docusaurus/theme-common": "2.2.0",
|
"@docusaurus/theme-common": "2.2.0",
|
||||||
"@docusaurus/types": "2.2.0",
|
"@docusaurus/types": "2.2.0",
|
||||||
"docusaurus-plugin-typedoc": "^0.18.0"
|
"docusaurus-plugin-typedoc": "1.0.0-next.2",
|
||||||
|
"typedoc": "^0.23.24",
|
||||||
|
"typedoc-plugin-markdown": "4.0.0-next.2"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
|
|||||||
@@ -14,61 +14,28 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
referenceSidebar: [
|
referenceSidebar: [
|
||||||
"reference/index",
|
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
label: "@auth/core",
|
label: "@auth/core",
|
||||||
link: {
|
link: { type: "doc", id: "reference/core/index" },
|
||||||
type: "doc",
|
items: [{ type: "autogenerated", dirName: "reference/core" }],
|
||||||
id: "reference/core/modules/main",
|
|
||||||
},
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
type: "autogenerated",
|
|
||||||
dirName: "reference/03-core/modules",
|
|
||||||
// See: https://github.com/facebook/docusaurus/issues/5689
|
|
||||||
// exclude: ["index"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: "category",
|
|
||||||
label: "Reflections",
|
|
||||||
collapsed: true,
|
|
||||||
className: "reflection-category", // See src/index.css
|
|
||||||
items: [{ type: "autogenerated", dirName: "reference/03-core" }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
label: "@auth/sveltekit",
|
label: "@auth/sveltekit",
|
||||||
link: { type: "doc", id: "reference/sveltekit/modules/main" },
|
link: { type: "doc", id: "reference/sveltekit/index" },
|
||||||
items: [
|
items: [{ type: "autogenerated", dirName: "reference/sveltekit" }],
|
||||||
{ type: "autogenerated", dirName: "reference/04-sveltekit/modules" },
|
|
||||||
{
|
|
||||||
type: "category",
|
|
||||||
label: "Reflections",
|
|
||||||
collapsed: true,
|
|
||||||
className: "reflection-category", // See src/index.css
|
|
||||||
items: [{ type: "autogenerated", dirName: "reference/04-sveltekit" }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
label: "@auth/solid-start",
|
label: "@auth/solid-start",
|
||||||
link: {
|
link: { type: "doc", id: "reference/solidstart/index" },
|
||||||
type: "doc",
|
items: [{ type: "autogenerated", dirName: "reference/04-solidstart" }],
|
||||||
id: "reference/solidstart/index",
|
|
||||||
},
|
|
||||||
items: ["reference/solidstart/client", "reference/solidstart/protected"],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
label: "@auth/nextjs",
|
label: "@auth/nextjs",
|
||||||
link: {
|
link: { type: "doc", id: "reference/nextjs/index" },
|
||||||
type: "doc",
|
|
||||||
id: "reference/nextjs/index",
|
|
||||||
},
|
|
||||||
items: [
|
items: [
|
||||||
"reference/nextjs/client",
|
"reference/nextjs/client",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -272,27 +272,4 @@ html[data-theme="dark"] #carbonads > span {
|
|||||||
html[data-theme="dark"] #carbonads .carbon-poweredby {
|
html[data-theme="dark"] #carbonads .carbon-poweredby {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
background: #1e2021;
|
background: #1e2021;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
This is a hack to hide the "Reflection" category and "main" module from the sidebar.
|
|
||||||
This is because:
|
|
||||||
1. opening any page under the "Reflection" category would hide the entire sidebar.
|
|
||||||
2. the "main" module would show up twice.
|
|
||||||
See sidebars.js
|
|
||||||
*/
|
|
||||||
.reflection-category,
|
|
||||||
.theme-doc-sidebar-item-link-level-2 [href="/reference/core/modules/main"],
|
|
||||||
.theme-doc-sidebar-item-link-level-2
|
|
||||||
[href="/reference/sveltekit/modules/main"] {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
HACK: to hide the "Classes" header and duplicate items together with the "typedoc-plugin-markdown" patch.
|
|
||||||
See: https://github.com/TypeStrong/typedoc/issues/2006
|
|
||||||
*/
|
|
||||||
/* h3.anchor + p:has(code, strong), */ /** hack did not work as it hides property types elsewhere */
|
|
||||||
#classes {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
@@ -1,23 +1,16 @@
|
|||||||
{
|
{
|
||||||
"excludeNotDocumented": true,
|
|
||||||
"$schema": "https://typedoc.org/schema.json",
|
"$schema": "https://typedoc.org/schema.json",
|
||||||
"allReflectionsHaveOwnDocument": true,
|
"cleanOutputDir": true,
|
||||||
"disableSources": true,
|
"disableSources": true,
|
||||||
"hideBreadcrumbs": true,
|
|
||||||
"excludeExternals": true,
|
"excludeExternals": true,
|
||||||
"excludeInternal": true,
|
"excludeInternal": true,
|
||||||
|
"excludeNotDocumented": true,
|
||||||
"excludePrivate": true,
|
"excludePrivate": true,
|
||||||
"cleanOutputDir": true,
|
|
||||||
"excludeProtected": true,
|
"excludeProtected": true,
|
||||||
|
"hideHierarchy": true,
|
||||||
"gitRevision": "main",
|
"gitRevision": "main",
|
||||||
|
"hideBreadcrumbs": true,
|
||||||
"hideGenerator": true,
|
"hideGenerator": true,
|
||||||
"intentionallyNotExported": [
|
|
||||||
"ReturnTypes",
|
|
||||||
"CallbackParameters",
|
|
||||||
"JsonValue"
|
|
||||||
],
|
|
||||||
"readme": "none",
|
|
||||||
"sort": ["kind", "static-first", "required-first", "alphabetical"],
|
|
||||||
"kindSortOrder": [
|
"kindSortOrder": [
|
||||||
"Function",
|
"Function",
|
||||||
"TypeAlias",
|
"TypeAlias",
|
||||||
@@ -41,5 +34,13 @@
|
|||||||
"IndexSignature",
|
"IndexSignature",
|
||||||
"GetSignature",
|
"GetSignature",
|
||||||
"SetSignature"
|
"SetSignature"
|
||||||
]
|
],
|
||||||
}
|
"readme": "none",
|
||||||
|
"sort": [
|
||||||
|
"kind",
|
||||||
|
"static-first",
|
||||||
|
"required-first",
|
||||||
|
"alphabetical"
|
||||||
|
],
|
||||||
|
"symbolsWithOwnFile": "none"
|
||||||
|
}
|
||||||
@@ -41,8 +41,6 @@
|
|||||||
"prettier": "2.8.1",
|
"prettier": "2.8.1",
|
||||||
"prettier-plugin-svelte": "^2.8.1",
|
"prettier-plugin-svelte": "^2.8.1",
|
||||||
"turbo": "1.6.3",
|
"turbo": "1.6.3",
|
||||||
"typedoc": "^0.23.22",
|
|
||||||
"typedoc-plugin-markdown": "^3.14.0",
|
|
||||||
"typescript": "4.9.4"
|
"typescript": "4.9.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -64,7 +62,6 @@
|
|||||||
"undici": "5.11.0"
|
"undici": "5.11.0"
|
||||||
},
|
},
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"typedoc-plugin-markdown@3.14.0": "patches/typedoc-plugin-markdown@3.14.0.patch",
|
|
||||||
"@balazsorban/monorepo-release@0.1.8": "patches/@balazsorban__monorepo-release@0.1.8.patch"
|
"@balazsorban/monorepo-release@0.1.8": "patches/@balazsorban__monorepo-release@0.1.8.patch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
* - [Getting started](https://authjs.dev/getting-started/introduction)
|
* - [Getting started](https://authjs.dev/getting-started/introduction)
|
||||||
* - [Most common use case guides](https://authjs.dev/guides)
|
* - [Most common use case guides](https://authjs.dev/guides)
|
||||||
*
|
*
|
||||||
* @module main
|
* @module index
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { assertConfig } from "./lib/assert.js"
|
import { assertConfig } from "./lib/assert.js"
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
* return {
|
* return {
|
||||||
* session: await event.locals.getSession()
|
* session: await event.locals.getSession()
|
||||||
* };
|
* };
|
||||||
* };
|
* };
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* What you return in the function `LayoutServerLoad` will be available inside the `$page` store, in the `data` property: `$page.data`.
|
* What you return in the function `LayoutServerLoad` will be available inside the `$page` store, in the `data` property: `$page.data`.
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
* return {};
|
* return {};
|
||||||
* };
|
* };
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* :::danger
|
* :::danger
|
||||||
* Make sure to ALWAYS grab the session information from the parent instead of using the store in the case of a `PageLoad`.
|
* Make sure to ALWAYS grab the session information from the parent instead of using the store in the case of a `PageLoad`.
|
||||||
* Not doing so can lead to users being able to incorrectly access protected information in the case the `+layout.server.ts` does not run for that page load.
|
* Not doing so can lead to users being able to incorrectly access protected information in the case the `+layout.server.ts` does not run for that page load.
|
||||||
@@ -130,14 +130,14 @@
|
|||||||
* The handle hook, available in `hooks.server.ts`, is a function that receives ALL requests sent to your SvelteKit webapp.
|
* The handle hook, available in `hooks.server.ts`, is a function that receives ALL requests sent to your SvelteKit webapp.
|
||||||
* You may intercept them inside the handle hook, add and modify things in the request, block requests, etc.
|
* You may intercept them inside the handle hook, add and modify things in the request, block requests, etc.
|
||||||
* Some readers may notice we are already using this handle hook for SvelteKitAuth which returns a handle itself, so we are going to use SvelteKit's sequence to provide middleware-like functions that set the handle hook.
|
* Some readers may notice we are already using this handle hook for SvelteKitAuth which returns a handle itself, so we are going to use SvelteKit's sequence to provide middleware-like functions that set the handle hook.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* import { SvelteKitAuth } from '@auth/sveltekit';
|
* import { SvelteKitAuth } from '@auth/sveltekit';
|
||||||
* import GitHub from '@auth/core/providers/github';
|
* import GitHub from '@auth/core/providers/github';
|
||||||
* import { GITHUB_ID, GITHUB_SECRET } from '$env/static/private';
|
* import { GITHUB_ID, GITHUB_SECRET } from '$env/static/private';
|
||||||
* import { redirect, type Handle } from '@sveltejs/kit';
|
* import { redirect, type Handle } from '@sveltejs/kit';
|
||||||
* import { sequence } from '@sveltejs/kit/hooks';
|
* import { sequence } from '@sveltejs/kit/hooks';
|
||||||
*
|
*
|
||||||
* async function authorization({ event, resolve }) {
|
* async function authorization({ event, resolve }) {
|
||||||
* // Protect any routes under /authenticated
|
* // Protect any routes under /authenticated
|
||||||
* if (event.url.pathname.startsWith('/authenticated')) {
|
* if (event.url.pathname.startsWith('/authenticated')) {
|
||||||
@@ -146,14 +146,14 @@
|
|||||||
* throw redirect(303, '/auth');
|
* throw redirect(303, '/auth');
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* // If the request is still here, just proceed as normally
|
* // If the request is still here, just proceed as normally
|
||||||
* const result = await resolve(event, {
|
* const result = await resolve(event, {
|
||||||
* transformPageChunk: ({ html }) => html
|
* transformPageChunk: ({ html }) => html
|
||||||
* });
|
* });
|
||||||
* return result;
|
* return result;
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* // First handle authentication, then authorization
|
* // First handle authentication, then authorization
|
||||||
* // Each function acts as a middleware, receiving the request handle
|
* // Each function acts as a middleware, receiving the request handle
|
||||||
* // And returning a handle which gets passed to the next function
|
* // And returning a handle which gets passed to the next function
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
* PRs to improve this documentation are welcome! See [this file](https://github.com/nextauthjs/next-auth/blob/main/packages/frameworks-sveltekit/src/lib/index.ts).
|
* PRs to improve this documentation are welcome! See [this file](https://github.com/nextauthjs/next-auth/blob/main/packages/frameworks-sveltekit/src/lib/index.ts).
|
||||||
* :::
|
* :::
|
||||||
*
|
*
|
||||||
* @module main
|
* @module index
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/// <reference types="@sveltejs/kit" />
|
/// <reference types="@sveltejs/kit" />
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
diff --git a/dist/theme.js b/dist/theme.js
|
|
||||||
index 1483a4b4ec69583aa3086eac83b2b31ae8bb6777..c30e7a4f7785fc230099e8b904040dd4aa57c38e 100644
|
|
||||||
--- a/dist/theme.js
|
|
||||||
+++ b/dist/theme.js
|
|
||||||
@@ -221,12 +221,12 @@ class MarkdownTheme extends typedoc_1.Theme {
|
|
||||||
directory: 'enums',
|
|
||||||
template: this.getReflectionTemplate(),
|
|
||||||
},
|
|
||||||
- {
|
|
||||||
- kind: [typedoc_1.ReflectionKind.Class],
|
|
||||||
- isLeaf: false,
|
|
||||||
- directory: 'classes',
|
|
||||||
- template: this.getReflectionTemplate(),
|
|
||||||
- },
|
|
||||||
+ // {
|
|
||||||
+ // kind: [typedoc_1.ReflectionKind.Class],
|
|
||||||
+ // isLeaf: false,
|
|
||||||
+ // directory: 'classes',
|
|
||||||
+ // template: this.getReflectionTemplate(),
|
|
||||||
+ // },
|
|
||||||
{
|
|
||||||
kind: [typedoc_1.ReflectionKind.Interface],
|
|
||||||
isLeaf: false,
|
|
||||||
1677
pnpm-lock.yaml
generated
1677
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -43,6 +43,10 @@
|
|||||||
},
|
},
|
||||||
"@next-auth/upstash-redis-adapter#test": {
|
"@next-auth/upstash-redis-adapter#test": {
|
||||||
"env": ["UPSTASH_REDIS_KEY", "UPSTASH_REDIS_URL"]
|
"env": ["UPSTASH_REDIS_KEY", "UPSTASH_REDIS_URL"]
|
||||||
|
},
|
||||||
|
"docs#dev": {
|
||||||
|
"dependsOn": ["^build"],
|
||||||
|
"cache": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user