mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Compare commits
177 Commits
@auth/soli
...
patch-2
| Author | SHA1 | Date | |
|---|---|---|---|
| 0bcdec7857 | |||
|
|
93f9153d77 | ||
|
|
2c43f83fa6 | ||
|
|
7446969587 | ||
|
|
701edba1c1 | ||
|
|
8141c7e217 | ||
|
|
ab3f78bbae | ||
|
|
ff4519bdda | ||
|
|
52a93d0409 | ||
|
|
39ecfbd255 | ||
|
|
a39d35b341 | ||
|
|
1cee92563f | ||
|
|
e3845270c6 | ||
|
|
2510f74809 | ||
|
|
27b2519b84 | ||
|
|
5f15b0704a | ||
|
|
e4573ffff5 | ||
|
|
4ce1951a2b | ||
|
|
c95531d651 | ||
|
|
654d52bb56 | ||
|
|
b72d7be9be | ||
|
|
76fcc4e70c | ||
|
|
4cacf504dd | ||
|
|
50eb23f626 | ||
|
|
d813c00b3e | ||
|
|
fc4448a85a | ||
|
|
16f781c091 | ||
|
|
ebfdaece0e | ||
|
|
64a190e549 | ||
|
|
e11f898c10 | ||
|
|
dcb11da2e2 | ||
|
|
9f900befe6 | ||
|
|
09c2a89df8 | ||
|
|
20c3fe3331 | ||
|
|
e26f500d18 | ||
|
|
494d16e54d | ||
|
|
5a8aa2e5e5 | ||
|
|
05ff6ae221 | ||
|
|
1fbc684f53 | ||
|
|
124be4fb1f | ||
|
|
3b0128c3ca | ||
|
|
36b97aafb8 | ||
|
|
175d37499b | ||
|
|
08a6835a70 | ||
|
|
448a11ff0a | ||
|
|
f39f9708bd | ||
|
|
6d98b8b33c | ||
|
|
ef7ec044c5 | ||
|
|
e89e3143d7 | ||
|
|
12f0795a0a | ||
|
|
9e0036bc73 | ||
|
|
27aa5ef09b | ||
|
|
903bd6fac9 | ||
|
|
998b7a0db4 | ||
|
|
465644f9e4 | ||
|
|
d12bd5a799 | ||
|
|
3897d47db2 | ||
|
|
e44dccc42d | ||
|
|
733a81bd3a | ||
|
|
f06f3bbc96 | ||
|
|
aea27a1fa8 | ||
|
|
bd37c55241 | ||
|
|
169a5230db | ||
|
|
f48eb0478e | ||
|
|
b25a090c17 | ||
|
|
0167e9368b | ||
|
|
dcb576f01b | ||
|
|
9417822a41 | ||
|
|
14f8f0cb58 | ||
|
|
212272a839 | ||
|
|
a8e8b7542c | ||
|
|
14cecb9b73 | ||
|
|
28bec0fbcc | ||
|
|
bc683a5b72 | ||
|
|
e7b8597f73 | ||
|
|
5c89a21bfa | ||
|
|
6e9c8b5b3c | ||
|
|
91a9e5f601 | ||
|
|
cb916f4848 | ||
|
|
8259cd4fc6 | ||
|
|
7a8c0068c4 | ||
|
|
6edb6ddaaf | ||
|
|
0711d32a00 | ||
|
|
c261af4695 | ||
|
|
d69f311ddc | ||
|
|
ec8a34308b | ||
|
|
c0bf2f15fb | ||
|
|
d8901777bf | ||
|
|
319f2ce165 | ||
|
|
2d907f0004 | ||
|
|
2954588be7 | ||
|
|
4026183411 | ||
|
|
86d031faba | ||
|
|
1e3745d22a | ||
|
|
feaeda9e2a | ||
|
|
e127600ad4 | ||
|
|
cb3137133c | ||
|
|
b3eaf6329e | ||
|
|
8aa1789697 | ||
|
|
a7601d0b45 | ||
|
|
bb8d826bc7 | ||
|
|
f787809cd4 | ||
|
|
7789fa17b5 | ||
|
|
740c505901 | ||
|
|
1e579cbaa6 | ||
|
|
65aacbe97a | ||
|
|
7dbfa5da4d | ||
|
|
98bd774b75 | ||
|
|
3661ca68b0 | ||
|
|
7ba986b01e | ||
|
|
e638ec5eb1 | ||
|
|
7327468697 | ||
|
|
9a9c24897d | ||
|
|
e362653819 | ||
|
|
a92e348ed3 | ||
|
|
ab0857a99e | ||
|
|
50b117dfbb | ||
|
|
e6590ffc20 | ||
|
|
26c846594f | ||
|
|
2432ce9001 | ||
|
|
0a689b4f4e | ||
|
|
2fb34bab51 | ||
|
|
d0e7689d07 | ||
|
|
c004659174 | ||
|
|
c212e96f83 | ||
|
|
d41f2a4a02 | ||
|
|
5ecf20a804 | ||
|
|
9e423f3252 | ||
|
|
cf810f246a | ||
|
|
05fe398b1a | ||
|
|
8659c02366 | ||
|
|
2e039643b6 | ||
|
|
3943f9b7b2 | ||
|
|
f2e85c2113 | ||
|
|
c53c868288 | ||
|
|
0bc4fcb51a | ||
|
|
139c2edb50 | ||
|
|
4e94d89554 | ||
|
|
43d66fcb23 | ||
|
|
bfcf1a3604 | ||
|
|
5b1555ed97 | ||
|
|
0ed07b31b6 | ||
|
|
2311be7589 | ||
|
|
e847b3466f | ||
|
|
8df6d5b469 | ||
|
|
0bcaeca369 | ||
|
|
4f5ddbcb76 | ||
|
|
0cbeb4055e | ||
|
|
5a128db369 | ||
|
|
c385cf8c7c | ||
|
|
53fa46744c | ||
|
|
451eaaabd2 | ||
|
|
f54424c216 | ||
|
|
09bcc1d504 | ||
|
|
6ecf9cb93d | ||
|
|
ba2711d279 | ||
|
|
03881bf98f | ||
|
|
230164f751 | ||
|
|
fecf5e0a1c | ||
|
|
400d0f1842 | ||
|
|
39657bf06c | ||
|
|
d1dd8d95c4 | ||
|
|
554ec439c9 | ||
|
|
8e4db3899a | ||
|
|
444b99ee96 | ||
|
|
f12b527300 | ||
|
|
ac48211967 | ||
|
|
2bd60f6626 | ||
|
|
a83573ed2f | ||
|
|
6242aa7ecb | ||
|
|
54cbbadc8f | ||
|
|
fd4af6512e | ||
|
|
6482e359b7 | ||
|
|
64aac2efc0 | ||
|
|
df37a24c23 | ||
|
|
8bcdf8e818 | ||
|
|
dd765a1b45 |
@@ -1,70 +0,0 @@
|
|||||||
.eslintrc.js
|
|
||||||
.cache-loader
|
|
||||||
.DS_Store
|
|
||||||
.pnpm-debug.log
|
|
||||||
.turbo
|
|
||||||
.vscode/generated*
|
|
||||||
/_work
|
|
||||||
/actions-runner
|
|
||||||
node_modules
|
|
||||||
patches
|
|
||||||
pnpm-lock.yaml
|
|
||||||
.github/actions/issue-validator/index.mjs
|
|
||||||
*.cjs
|
|
||||||
*.js
|
|
||||||
*.d.ts
|
|
||||||
*.d.ts.map
|
|
||||||
|
|
||||||
.svelte-kit
|
|
||||||
.next
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# --------------- Docs ---------------
|
|
||||||
|
|
||||||
.docusaurus
|
|
||||||
build
|
|
||||||
docs/docs/reference/core
|
|
||||||
docs/docs/reference/sveltekit
|
|
||||||
static
|
|
||||||
|
|
||||||
# --------------- Packages ---------------
|
|
||||||
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
|
|
||||||
# @auth/core
|
|
||||||
packages/core/src/providers/oauth-types.ts
|
|
||||||
packages/core/src/lib/pages/styles.ts
|
|
||||||
|
|
||||||
# @auth/sveltekit
|
|
||||||
packages/frameworks-sveltekit/package
|
|
||||||
packages/frameworks-sveltekit/vite.config.{js,ts}.timestamp-*
|
|
||||||
|
|
||||||
# next-auth
|
|
||||||
packages/next-auth/src/providers/oauth-types.ts
|
|
||||||
packages/next-auth/css/index.css
|
|
||||||
|
|
||||||
|
|
||||||
# Adapters
|
|
||||||
.branches
|
|
||||||
db.sqlite
|
|
||||||
dev.db
|
|
||||||
dynamodblocal-bin
|
|
||||||
firebase-debug.log
|
|
||||||
firestore-debug.log
|
|
||||||
migrations
|
|
||||||
test.schema.gql
|
|
||||||
|
|
||||||
# --------------- Apps ---------------
|
|
||||||
|
|
||||||
|
|
||||||
# Examples should have their own Prettier config since they are templates too
|
|
||||||
apps/example-sveltekit
|
|
||||||
|
|
||||||
# Development app
|
|
||||||
apps
|
|
||||||
|
|
||||||
|
|
||||||
# --------------- Tests ---------------
|
|
||||||
# TODO: these should be linted
|
|
||||||
packages/**/*test*
|
|
||||||
86
.eslintrc.js
86
.eslintrc.js
@@ -1,75 +1,41 @@
|
|||||||
// @ts-check
|
const path = require("path")
|
||||||
|
|
||||||
/** @type {import("eslint").ESLint.ConfigData} */
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
env: { browser: true, es2022: true, node: true },
|
root: true,
|
||||||
extends: ["eslint:recommended", "prettier"],
|
parser: "@typescript-eslint/parser",
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ["*.ts", "*.tsx"],
|
files: ["*.ts", "*.tsx"],
|
||||||
parser: "@typescript-eslint/parser",
|
extends: ["standard-with-typescript", "prettier"],
|
||||||
parserOptions: {
|
|
||||||
project: ["./packages/**/tsconfig.json", "./apps/**/tsconfig.json"],
|
|
||||||
},
|
|
||||||
settings: { react: { version: "18" } },
|
|
||||||
extends: [
|
|
||||||
"plugin:react/recommended",
|
|
||||||
"plugin:react/jsx-runtime",
|
|
||||||
"standard-with-typescript",
|
|
||||||
"prettier",
|
|
||||||
],
|
|
||||||
rules: {
|
rules: {
|
||||||
"@typescript-eslint/explicit-function-return-type": "off",
|
camelcase: "off",
|
||||||
"@typescript-eslint/method-signature-style": "off",
|
|
||||||
"@typescript-eslint/naming-convention": "off",
|
"@typescript-eslint/naming-convention": "off",
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
|
||||||
"@typescript-eslint/restrict-template-expressions": "off",
|
|
||||||
"@typescript-eslint/strict-boolean-expressions": "off",
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
||||||
"react/prop-types": "off",
|
"@typescript-eslint/explicit-function-return-type": "off",
|
||||||
"react/no-unescaped-entities": "off",
|
"@typescript-eslint/restrict-template-expressions": "off",
|
||||||
},
|
},
|
||||||
},
|
|
||||||
{
|
parserOptions: {
|
||||||
files: ["*.test.ts", "*.test.js"],
|
project: [
|
||||||
extends: ["plugin:jest/recommended"],
|
path.resolve(__dirname, "./packages/**/tsconfig.eslint.json"),
|
||||||
env: { jest: true },
|
path.resolve(__dirname, "./packages/frameworks/**/tsconfig.json"),
|
||||||
},
|
path.resolve(__dirname, "./apps/**/tsconfig.json"),
|
||||||
{
|
|
||||||
files: ["docs/**"],
|
|
||||||
plugins: ["@docusaurus"],
|
|
||||||
extends: ["plugin:@docusaurus/recommended"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// TODO: Expand to all packages
|
|
||||||
files: ["packages/{core,sveltekit}/*.ts"],
|
|
||||||
plugins: ["jsdoc"],
|
|
||||||
extends: ["plugin:jsdoc/recommended"],
|
|
||||||
rules: {
|
|
||||||
"jsdoc/require-param": "off",
|
|
||||||
"jsdoc/require-returns": "off",
|
|
||||||
"jsdoc/require-jsdoc": [
|
|
||||||
"warn",
|
|
||||||
{ publicOnly: true, enableFixer: false },
|
|
||||||
],
|
],
|
||||||
"jsdoc/no-multi-asterisks": ["warn", { allowWhitespace: true }],
|
|
||||||
"jsdoc/tag-lines": "off",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
files: ["packages/frameworks-sveltekit"],
|
|
||||||
plugins: ["svelte3"],
|
|
||||||
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
|
|
||||||
settings: {
|
|
||||||
"svelte3/typescript": () => require("typescript"),
|
|
||||||
},
|
|
||||||
parserOptions: { sourceType: "module", ecmaVersion: 2020 },
|
|
||||||
env: { browser: true, es2017: true, node: true },
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
parserOptions: {
|
extends: ["prettier"],
|
||||||
sourceType: "module",
|
globals: {
|
||||||
ecmaVersion: "latest",
|
localStorage: "readonly",
|
||||||
ecmaFeatures: { jsx: true },
|
location: "readonly",
|
||||||
|
fetch: "readonly",
|
||||||
},
|
},
|
||||||
root: true,
|
rules: {
|
||||||
|
camelcase: "off",
|
||||||
|
},
|
||||||
|
plugins: ["jest"],
|
||||||
|
env: {
|
||||||
|
"jest/globals": true,
|
||||||
|
},
|
||||||
|
ignorePatterns: [".eslintrc.js"],
|
||||||
}
|
}
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/1_bug_framework.yml
vendored
2
.github/ISSUE_TEMPLATE/1_bug_framework.yml
vendored
@@ -30,7 +30,7 @@ body:
|
|||||||
Run this command in your project's root folder and paste the result:
|
Run this command in your project's root folder and paste the result:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth,@auth/*"
|
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth"
|
||||||
```
|
```
|
||||||
Alternatively, you can manually gather the version information from your package.json for these packages: "next", "react" and "next-auth". Please also mention your OS and Node.js version, as well as the browser you are using.
|
Alternatively, you can manually gather the version information from your package.json for these packages: "next", "react" and "next-auth". Please also mention your OS and Node.js version, as well as the browser you are using.
|
||||||
validations:
|
validations:
|
||||||
|
|||||||
5
.github/ISSUE_TEMPLATE/2_bug_provider.yml
vendored
5
.github/ISSUE_TEMPLATE/2_bug_provider.yml
vendored
@@ -25,14 +25,12 @@ body:
|
|||||||
- "Custom provider"
|
- "Custom provider"
|
||||||
- "42 School"
|
- "42 School"
|
||||||
- "Apple"
|
- "Apple"
|
||||||
- "Asgardeo"
|
|
||||||
- "Atlassian"
|
- "Atlassian"
|
||||||
- "Auth0"
|
- "Auth0"
|
||||||
- "Authentik"
|
- "Authentik"
|
||||||
- "Azure Active Directory"
|
- "Azure Active Directory"
|
||||||
- "Azure Active Directory B2C"
|
- "Azure Active Directory B2C"
|
||||||
- "Battlenet"
|
- "Battlenet"
|
||||||
- "Beyond Identity"
|
|
||||||
- "Box"
|
- "Box"
|
||||||
- "Bungie"
|
- "Bungie"
|
||||||
- "Cognito"
|
- "Cognito"
|
||||||
@@ -59,7 +57,6 @@ body:
|
|||||||
- "Medium"
|
- "Medium"
|
||||||
- "Naver"
|
- "Naver"
|
||||||
- "Netlify"
|
- "Netlify"
|
||||||
- "Notion"
|
|
||||||
- "Okta"
|
- "Okta"
|
||||||
- "OneLogin"
|
- "OneLogin"
|
||||||
- "Osso"
|
- "Osso"
|
||||||
@@ -90,7 +87,7 @@ body:
|
|||||||
Run this command in your project's root folder and paste the result:
|
Run this command in your project's root folder and paste the result:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth,@auth/*"
|
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth"
|
||||||
```
|
```
|
||||||
Alternatively, you can manually gather the version information from your package.json for these packages: "next", "react" and "next-auth". Please also mention your OS and Node.js version, as well as the browser you are using.
|
Alternatively, you can manually gather the version information from your package.json for these packages: "next", "react" and "next-auth". Please also mention your OS and Node.js version, as well as the browser you are using.
|
||||||
validations:
|
validations:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/3_bug_adapter.yml
vendored
2
.github/ISSUE_TEMPLATE/3_bug_adapter.yml
vendored
@@ -44,7 +44,7 @@ body:
|
|||||||
Run this command in your project's root folder and paste the result:
|
Run this command in your project's root folder and paste the result:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth,@auth/*" && npx envinfo --npmPackages "@next-auth/*"
|
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth" && npx envinfo --npmPackages "@next-auth/*"
|
||||||
```
|
```
|
||||||
Alternatively, if the above command did not work, we need the version of the following packages from your package.json: "next", "react", "next-auth" and your adapter. Please also mention your OS and Node.js version, as well as the browser you are using.
|
Alternatively, if the above command did not work, we need the version of the following packages from your package.json: "next", "react", "next-auth" and your adapter. Please also mention your OS and Node.js version, as well as the browser you are using.
|
||||||
validations:
|
validations:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1 +1 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -8,7 +8,7 @@ merge of your pull request!
|
|||||||
> _NOTE_:
|
> _NOTE_:
|
||||||
>
|
>
|
||||||
> - It's a good idea to open an issue first to discuss potential changes.
|
> - It's a good idea to open an issue first to discuss potential changes.
|
||||||
> - Please make sure that you are _NOT_ opening a PR to fix a potential security vulnerability. Instead, please follow the [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md) to disclose the issue to us confidentially.
|
> - Please make sure that you are _NOT_ opening a PR to fix a potential security vulnerability. Instead, please follow the [Security guidelines](../Security.md) to disclose the issue to us confidentially.
|
||||||
|
|
||||||
## ☕️ Reasoning
|
## ☕️ Reasoning
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Fixes: INSERT_ISSUE_LINK_HERE
|
|||||||
|
|
||||||
## 📌 Resources
|
## 📌 Resources
|
||||||
|
|
||||||
- [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md)
|
- [Security guidelines](../Security.md)
|
||||||
- [Contributing guidelines](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md)
|
- [Contributing guidelines](../CONTRIBUTING.md)
|
||||||
- [Code of conduct](https://github.com/nextauthjs/.github/blob/main/CODE_OF_CONDUCT.md)
|
- [Code of conduct](../CODE_OF_CONDUCT.md)
|
||||||
- [Contributing to Open Source](https://kcd.im/pull-request)
|
- [Contributing to Open Source](https://kcd.im/pull-request)
|
||||||
|
|||||||
2
.github/actions/issue-validator/index.mjs
vendored
2
.github/actions/issue-validator/index.mjs
vendored
File diff suppressed because one or more lines are too long
3
.github/actions/issue-validator/licenses.txt
vendored
3
.github/actions/issue-validator/licenses.txt
vendored
@@ -526,7 +526,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||||||
root
|
root
|
||||||
ISC License
|
ISC License
|
||||||
|
|
||||||
Copyright (c) 2022-2023, Balázs Orbán
|
Copyright (c) 2018-2021, Iain Collins
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -540,7 +540,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
tr46
|
tr46
|
||||||
MIT
|
MIT
|
||||||
|
|
||||||
|
|||||||
1
.github/actions/issue-validator/repro.md
vendored
1
.github/actions/issue-validator/repro.md
vendored
@@ -35,3 +35,4 @@ Upvoting issues to show your interest will help us prioritize and address them a
|
|||||||
- [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve)
|
- [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve)
|
||||||
- [Reporting a NextAuth.js bug](https://github.com/nextauthjs/next-auth/blob/main/.github/ISSUE_TEMPLATE/1_bug_framework.yml)
|
- [Reporting a NextAuth.js bug](https://github.com/nextauthjs/next-auth/blob/main/.github/ISSUE_TEMPLATE/1_bug_framework.yml)
|
||||||
- [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc)
|
- [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc)
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import { readFileSync } from "node:fs"
|
|||||||
import { join } from "node:path"
|
import { join } from "node:path"
|
||||||
|
|
||||||
const addReproductionLabel = "incomplete"
|
const addReproductionLabel = "incomplete"
|
||||||
|
const __dirname =
|
||||||
|
"/home/runner/work/nextauthjs/next-auth/.github/actions/issue-validator"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{
|
* @typedef {{
|
||||||
@@ -71,12 +73,7 @@ async function run() {
|
|||||||
}),
|
}),
|
||||||
client.issues.createComment({
|
client.issues.createComment({
|
||||||
...issueCommon,
|
...issueCommon,
|
||||||
body: readFileSync(
|
body: readFileSync(join(__dirname, "repro.md"), "utf8"),
|
||||||
join(
|
|
||||||
"/home/runner/work/next-auth/next-auth/.github/actions/issue-validator/repro.md"
|
|
||||||
),
|
|
||||||
"utf8"
|
|
||||||
),
|
|
||||||
}),
|
}),
|
||||||
])
|
])
|
||||||
return core.info(
|
return core.info(
|
||||||
|
|||||||
98
.github/pr-labeler.yml
vendored
98
.github/pr-labeler.yml
vendored
@@ -1,26 +1,74 @@
|
|||||||
# https://github.com/actions/labeler#create-githublabeleryml
|
# https://github.com/actions/labeler#create-githublabeleryml
|
||||||
adapters: ["packages/core/src/adapters.ts", "packages/adapter-*/**/*"]
|
|
||||||
core: ["packages/core/src/**/*"]
|
test:
|
||||||
dgraph: ["packages/adapter-dgraph/**/*"]
|
- test/**/*
|
||||||
documentation: ["packages/docs/docs/**/*"]
|
- types/tests/**/*
|
||||||
dynamodb: ["packages/adapter-dynamodb/**/*"]
|
|
||||||
examples: ["apps/examples/**/*"]
|
providers:
|
||||||
fauna: ["packages/adapter-fauna/**/*"]
|
- packages/next-auth/src/providers/**/*
|
||||||
firebase: ["packages/adapter-firebase/**/*"]
|
- test/integration/**/*
|
||||||
frameworks: ["packages/frameworks-*/**/*"]
|
|
||||||
legacy: ["packages/next-auth/**/*"]
|
adapters:
|
||||||
mikro-orm: ["packages/adapter-mikro-orm/**/*"]
|
- packages/next-auth/src/adapters.ts
|
||||||
mongodb: ["packages/adapter-mongodb/**/*"]
|
- packages/adapter-*/**
|
||||||
neo4j: ["packages/adapter-neo4j/**/*"]
|
|
||||||
playgrounds: ["apps/playgrounds/**/*"]
|
dgraph:
|
||||||
pouchdb: ["packages/adapter-pouchdb/**/*"]
|
- packages/adapter-dgraph/**
|
||||||
prisma: ["packages/adapter-prisma/**/*"]
|
|
||||||
providers: ["packages/core/src/providers/**/*"]
|
dynamodb:
|
||||||
sequelize: ["packages/adapter-sequelize/**/*"]
|
- packages/adapter-dynamodb/**
|
||||||
solidjs: ["packages/frameworks-solid-start/**/*"]
|
|
||||||
supabase: ["packages/adapter-supabase/**/*"]
|
fauna:
|
||||||
svelte: ["packages/frameworks-sveltekit/**/*"]
|
- packages/adapter-fauna/**
|
||||||
test: ["**test**/*"]
|
|
||||||
typeorm-legacy: ["packages/adapter-typeorm-legacy/**/*"]
|
firebase:
|
||||||
upstash-redis: ["packages/adapter-upstash-redis/**/*"]
|
- packages/adapter-firebase/**
|
||||||
xata: ["packages/adapter-xata/**/*"]
|
|
||||||
|
mikro-orm:
|
||||||
|
- packages/adapter-mikro-orm/**
|
||||||
|
|
||||||
|
mongodb:
|
||||||
|
- packages/adapter-mongodb/**
|
||||||
|
|
||||||
|
neo4j:
|
||||||
|
- packages/adapter-neo4j/**
|
||||||
|
|
||||||
|
pouchdb:
|
||||||
|
- packages/adapter-pouchdb/**
|
||||||
|
|
||||||
|
prisma:
|
||||||
|
- packages/adapter-prisma/**
|
||||||
|
|
||||||
|
sequelize:
|
||||||
|
- packages/adapter-sequelize/**
|
||||||
|
|
||||||
|
supabase:
|
||||||
|
- packages/adapter-supabase/**
|
||||||
|
|
||||||
|
typeorm-legacy:
|
||||||
|
- packages/adapter-typeorm-legacy/**
|
||||||
|
|
||||||
|
upstash-redis:
|
||||||
|
- packages/adapter-upstash-redis/**
|
||||||
|
|
||||||
|
xata:
|
||||||
|
- packages/adapter-xata/**
|
||||||
|
|
||||||
|
legacy:
|
||||||
|
- packages/next-auth/src/**/*
|
||||||
|
|
||||||
|
style:
|
||||||
|
- packages/next-auth/src/css/**/*
|
||||||
|
|
||||||
|
client:
|
||||||
|
- packages/next-auth/src/client/**/*
|
||||||
|
- packages/next-auth/src/react/**/*
|
||||||
|
|
||||||
|
pages:
|
||||||
|
- packages/next-auth/src/core/pages/**/*
|
||||||
|
|
||||||
|
TypeScript:
|
||||||
|
- packages/next-auth/src/**/types.ts
|
||||||
|
|
||||||
|
documentation:
|
||||||
|
- packages/docs/docs/**/*
|
||||||
|
|||||||
22
.github/sync.yml
vendored
22
.github/sync.yml
vendored
@@ -1,22 +0,0 @@
|
|||||||
# Note that nextauthjs/next-auth-example syncs from the v4 branch
|
|
||||||
|
|
||||||
nextauthjs/sveltekit-auth-example:
|
|
||||||
- source: apps/examples/sveltekit
|
|
||||||
dest: .
|
|
||||||
deleteOrphaned: true
|
|
||||||
- .github/FUNDING.yml
|
|
||||||
- LICENSE
|
|
||||||
|
|
||||||
nextauthjs/solid-start-auth-example:
|
|
||||||
- source: "apps/examples/solid-start"
|
|
||||||
dest: .
|
|
||||||
deleteOrphaned: true
|
|
||||||
- .github/FUNDING.yml
|
|
||||||
- LICENSE
|
|
||||||
|
|
||||||
nextauthjs/next-auth-gatsby-example:
|
|
||||||
- source: apps/playgrounds/gatsby
|
|
||||||
dest: .
|
|
||||||
deleteOrphaned: true
|
|
||||||
- .github/FUNDING.yml
|
|
||||||
- LICENSE
|
|
||||||
6
.github/workflows/issue-validator.yml
vendored
6
.github/workflows/issue-validator.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: "Run issue validator"
|
- name: 'Run issue validator'
|
||||||
run: node /home/runner/work/next-auth/next-auth/.github/actions/issue-validator/index.mjs
|
run: node ./.github/actions/issue-validator/index.mjs
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
59
.github/workflows/release.yml
vendored
59
.github/workflows/release.yml
vendored
@@ -7,6 +7,7 @@ on:
|
|||||||
- "beta"
|
- "beta"
|
||||||
- "next"
|
- "next"
|
||||||
- "3.x"
|
- "3.x"
|
||||||
|
- "v4"
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -20,6 +21,8 @@ jobs:
|
|||||||
fetch-depth: 2
|
fetch-depth: 2
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v2.2.4
|
uses: pnpm/action-setup@v2.2.4
|
||||||
|
with:
|
||||||
|
version: 7.5.1
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@@ -27,30 +30,18 @@ jobs:
|
|||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
|
- name: Build
|
||||||
|
run: pnpm build
|
||||||
|
env:
|
||||||
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: pnpm test
|
run: pnpm test
|
||||||
timeout-minutes: 15
|
|
||||||
env:
|
env:
|
||||||
UPSTASH_REDIS_URL: ${{ secrets.UPSTASH_REDIS_URL }}
|
UPSTASH_REDIS_URL: ${{ secrets.UPSTASH_REDIS_URL }}
|
||||||
UPSTASH_REDIS_KEY: ${{ secrets.UPSTASH_REDIS_KEY }}
|
UPSTASH_REDIS_KEY: ${{ secrets.UPSTASH_REDIS_KEY }}
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
||||||
# - name: Run E2E tests
|
|
||||||
# if: github.repository == 'nextauthjs/next-auth'
|
|
||||||
# run: pnpm e2e
|
|
||||||
# timeout-minutes: 15
|
|
||||||
# env:
|
|
||||||
# AUTH0_USERNAME: ${{ secrets.AUTH0_USERNAME }}
|
|
||||||
# AUTH0_PASSWORD: ${{ secrets.AUTH0_PASSWORD }}
|
|
||||||
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
# - name: Upload E2E artifacts
|
|
||||||
# if: github.repository == 'nextauthjs/next-auth'
|
|
||||||
# uses: actions/upload-artifact@v3
|
|
||||||
# with:
|
|
||||||
# name: playwright-report
|
|
||||||
# path: apps/dev/nextjs/playwright-report/
|
|
||||||
# retention-days: 30
|
|
||||||
# - name: Coverage
|
# - name: Coverage
|
||||||
# uses: codecov/codecov-action@v1
|
# uses: codecov/codecov-action@v1
|
||||||
# with:
|
# with:
|
||||||
@@ -67,9 +58,10 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GH_PAT_CLASSIC }}
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v2.2.4
|
uses: pnpm/action-setup@v2.2.4
|
||||||
|
with:
|
||||||
|
version: 7.5.1
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@@ -78,12 +70,15 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
- name: Publish to npm and GitHub
|
- name: Publish to npm and GitHub
|
||||||
run: pnpm release
|
run: |
|
||||||
|
git config --global user.email "balazsorban44@users.noreply.github.com"
|
||||||
|
git config --global user.name "Balázs Orbán"
|
||||||
|
pnpm release
|
||||||
env:
|
env:
|
||||||
# Use GH_PAT when this is fixed:
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
# https://github.com/github/roadmap/issues/622
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT_CLASSIC }}
|
NPM_TOKEN_PKG: ${{ secrets.NPM_TOKEN_PKG }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN_ORG: ${{ secrets.NPM_TOKEN_ORG }}
|
||||||
release-pr:
|
release-pr:
|
||||||
name: Publish PR
|
name: Publish PR
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -95,6 +90,8 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v2.2.4
|
uses: pnpm/action-setup@v2.2.4
|
||||||
|
with:
|
||||||
|
version: 7.5.1
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@@ -109,19 +106,19 @@ jobs:
|
|||||||
PR_NUMBER: ${{ github.event.number }}
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
- name: Publish to npm
|
- name: Publish to npm
|
||||||
run: |
|
run: |
|
||||||
cd packages/core
|
cd packages/next-auth
|
||||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
|
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
|
||||||
pnpm publish --no-git-checks --access public --tag experimental
|
pnpm publish --no-git-checks --access public --tag experimental
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PKG }}
|
||||||
- name: Comment version on PR
|
- name: Comment version on PR
|
||||||
uses: NejcZdovc/comment-pr@v2
|
uses: NejcZdovc/comment-pr@v2
|
||||||
with:
|
with:
|
||||||
message:
|
message:
|
||||||
"🎉 Experimental release [published 📦️ on npm](https://npmjs.com/package/@auth/core/v/${{ env.VERSION }})!\n \
|
"🎉 Experimental release [published 📦️ on npm](https://npmjs.com/package/next-auth/v/${{ env.VERSION }})!\n \
|
||||||
```sh\npnpm add @auth/core@${{ env.VERSION }}\n```\n \
|
```sh\npnpm add next-auth@${{ env.VERSION }}\n```\n \
|
||||||
```sh\nyarn add @auth/core@${{ env.VERSION }}\n```\n \
|
```sh\nyarn add next-auth@${{ env.VERSION }}\n```\n \
|
||||||
```sh\nnpm i @auth/core@${{ env.VERSION }}\n```"
|
```sh\nnpm i next-auth@${{ env.VERSION }}\n```"
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.determine-version.outputs.version }}
|
VERSION: ${{ steps.determine-version.outputs.version }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
19
.github/workflows/sync-examples.yml
vendored
19
.github/workflows/sync-examples.yml
vendored
@@ -1,19 +0,0 @@
|
|||||||
name: Sync Example Repositories
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
sync:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Run GitHub File Sync
|
|
||||||
uses: balazsorban44/repo-file-sync-action@master
|
|
||||||
with:
|
|
||||||
GH_PAT: ${{ secrets.GH_PAT }}
|
|
||||||
IS_FINE_GRAINED: true
|
|
||||||
SKIP_PR: true
|
|
||||||
ORIGINAL_MESSAGE: true
|
|
||||||
21
.gitignore
vendored
21
.gitignore
vendored
@@ -1,7 +1,7 @@
|
|||||||
# Misc
|
# Misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.npmrc
|
.npmrc
|
||||||
.eslintcache
|
|
||||||
.env
|
.env
|
||||||
.env.local
|
.env.local
|
||||||
.env.development.local
|
.env.development.local
|
||||||
@@ -12,7 +12,6 @@ npm-debug.log*
|
|||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
firebase-debug.log
|
firebase-debug.log
|
||||||
ui-debug.log
|
|
||||||
.pnpm-debug.log
|
.pnpm-debug.log
|
||||||
|
|
||||||
|
|
||||||
@@ -35,10 +34,9 @@ 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/*.d.ts*
|
||||||
|
packages/next-auth/*.js
|
||||||
packages/next-auth/next
|
packages/next-auth/next
|
||||||
packages/*/*.js
|
|
||||||
packages/*/*.d.ts
|
|
||||||
packages/*/*.d.ts.map
|
|
||||||
|
|
||||||
# Development app
|
# Development app
|
||||||
apps/dev/src/css
|
apps/dev/src/css
|
||||||
@@ -49,7 +47,7 @@ apps/dev/typeorm
|
|||||||
/.vs/slnx.sqlite-journal
|
/.vs/slnx.sqlite-journal
|
||||||
/.vs/slnx.sqlite
|
/.vs/slnx.sqlite
|
||||||
/.vs
|
/.vs
|
||||||
.vscode/generated*
|
.vscode
|
||||||
|
|
||||||
# Jetbrains
|
# Jetbrains
|
||||||
.idea
|
.idea
|
||||||
@@ -79,12 +77,11 @@ docs/.docusaurus
|
|||||||
docs/providers.json
|
docs/providers.json
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
packages/core/src/providers/oauth-types.ts
|
packages/core/adapters.*
|
||||||
|
packages/core/index.*
|
||||||
|
packages/core/jwt
|
||||||
packages/core/lib
|
packages/core/lib
|
||||||
packages/core/providers
|
packages/core/providers
|
||||||
packages/core/src/lib/pages/styles.ts
|
|
||||||
docs/docs/reference/core
|
|
||||||
docs/docs/reference/sveltekit
|
|
||||||
|
|
||||||
|
|
||||||
# SvelteKit
|
# SvelteKit
|
||||||
@@ -94,7 +91,3 @@ packages/frameworks-sveltekit/.svelte-kit
|
|||||||
packages/frameworks-sveltekit/package
|
packages/frameworks-sveltekit/package
|
||||||
packages/frameworks-sveltekit/vite.config.js.timestamp-*
|
packages/frameworks-sveltekit/vite.config.js.timestamp-*
|
||||||
packages/frameworks-sveltekit/vite.config.ts.timestamp-*
|
packages/frameworks-sveltekit/vite.config.ts.timestamp-*
|
||||||
|
|
||||||
# Adapters
|
|
||||||
|
|
||||||
docs/docs/reference/adapter
|
|
||||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
_
|
||||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
# npx pretty-quick --staged
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
.cache-loader
|
|
||||||
.DS_Store
|
|
||||||
.pnpm-debug.log
|
|
||||||
.turbo
|
|
||||||
.vscode/generated*
|
|
||||||
/_work
|
|
||||||
/actions-runner
|
|
||||||
node_modules
|
|
||||||
patches
|
|
||||||
pnpm-lock.yaml
|
|
||||||
.github/actions/issue-validator/index.mjs
|
|
||||||
*.d.ts
|
|
||||||
*.d.ts.map
|
|
||||||
|
|
||||||
.svelte-kit
|
|
||||||
.next
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# --------------- Docs ---------------
|
|
||||||
|
|
||||||
.docusaurus
|
|
||||||
build
|
|
||||||
docs/docs/reference/core
|
|
||||||
docs/docs/reference/sveltekit
|
|
||||||
static
|
|
||||||
docs/providers.json
|
|
||||||
|
|
||||||
# --------------- Packages ---------------
|
|
||||||
|
|
||||||
coverage
|
|
||||||
dist
|
|
||||||
packages/**/*.cjs
|
|
||||||
packages/**/*.js
|
|
||||||
|
|
||||||
# @auth/core
|
|
||||||
packages/core/src/providers/oauth-types.ts
|
|
||||||
packages/core/src/lib/pages/styles.ts
|
|
||||||
|
|
||||||
# @auth/sveltekit
|
|
||||||
packages/frameworks-sveltekit/package
|
|
||||||
packages/frameworks-sveltekit/vite.config.{js,ts}.timestamp-*
|
|
||||||
|
|
||||||
# next-auth
|
|
||||||
packages/next-auth/src/providers/oauth-types.ts
|
|
||||||
packages/next-auth/css/index.css
|
|
||||||
|
|
||||||
|
|
||||||
# Adapters
|
|
||||||
.branches
|
|
||||||
db.sqlite
|
|
||||||
dev.db
|
|
||||||
dynamodblocal-bin
|
|
||||||
firebase-debug.log
|
|
||||||
firestore-debug.log
|
|
||||||
migrations
|
|
||||||
test.schema.gql
|
|
||||||
|
|
||||||
# --------------- Apps ---------------
|
|
||||||
|
|
||||||
|
|
||||||
# Examples should have their own Prettier config since they are templates too
|
|
||||||
apps/example-sveltekit
|
|
||||||
|
|
||||||
# Development app
|
|
||||||
apps/dev/prisma
|
|
||||||
apps/dev/migrations
|
|
||||||
apps/dev/typeorm
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// @ts-check
|
|
||||||
|
|
||||||
/** @type {import("prettier").Config} */
|
|
||||||
module.exports = {
|
|
||||||
semi: false,
|
|
||||||
singleQuote: false,
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: [
|
|
||||||
"apps/dev/nextjs/pages/api/auth/[...nextauth].ts",
|
|
||||||
"docs/{sidebars,docusaurus.config}.js",
|
|
||||||
],
|
|
||||||
options: { printWidth: 150 },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ["**/*package.json"],
|
|
||||||
options: {
|
|
||||||
trailingComma: "none",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"files.exclude": {
|
|
||||||
"packages/core/{lib,providers,*.js,*.d.ts,*.d.ts.map}": true,
|
|
||||||
"packages/next-auth/{client,core,css,jwt,next,providers,react,utils,*.js,*.d.ts}": true
|
|
||||||
},
|
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
|
||||||
"openInGitHub.remote.branch": "main"
|
|
||||||
}
|
|
||||||
14
.vscode/snippets.code-snippets
vendored
14
.vscode/snippets.code-snippets
vendored
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"oauth2-spec": {
|
|
||||||
"description": "Markdown link to OAuth 2 specification",
|
|
||||||
"scope": "typescript",
|
|
||||||
"prefix": "oauth2",
|
|
||||||
"body": ["[OAuth 2](https://datatracker.ietf.org/doc/html/rfc6749)"]
|
|
||||||
},
|
|
||||||
"oidc-spec": {
|
|
||||||
"description": "Markdown link to OpenID Connect specification",
|
|
||||||
"scope": "typescript",
|
|
||||||
"prefix": "oidc",
|
|
||||||
"body": ["[OIDC](https://openid.net/specs/openid-connect-core-1_0.html)"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
4
LICENSE
4
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
ISC License
|
ISC License
|
||||||
|
|
||||||
Copyright (c) 2022-2023, Balázs Orbán
|
Copyright (c) 2018-2021, Iain Collins
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -12,4 +12,4 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
@@ -9,39 +9,20 @@ NEXTAUTH_URL=http://localhost:3000
|
|||||||
# and/or verification tokens.
|
# and/or verification tokens.
|
||||||
NEXTAUTH_SECRET=secret
|
NEXTAUTH_SECRET=secret
|
||||||
|
|
||||||
ASGARDEO_CLIENT_ID=
|
|
||||||
ASGARDEO_CLIENT_SECRET=
|
|
||||||
ASGARDEO_ISSUER=
|
|
||||||
|
|
||||||
AUTH0_ID=
|
AUTH0_ID=
|
||||||
AUTH0_SECRET=
|
AUTH0_SECRET=
|
||||||
AUTH0_ISSUER=
|
AUTH0_ISSUER=
|
||||||
|
|
||||||
# Beyond Identity Provider
|
|
||||||
BEYOND_IDENTITY_CLIENT_ID=
|
|
||||||
BEYOND_IDENTITY_CLIENT_SECRET=
|
|
||||||
BEYOND_IDENTITY_ISSUER=
|
|
||||||
|
|
||||||
GITHUB_ID=
|
|
||||||
GITHUB_SECRET=
|
|
||||||
|
|
||||||
NOTION_ID=
|
|
||||||
NOTION_SECRET=
|
|
||||||
NOTION_REDIRECT_URI=
|
|
||||||
|
|
||||||
IDS4_ID=
|
|
||||||
IDS4_SECRET=
|
|
||||||
IDS4_ISSUER=
|
|
||||||
|
|
||||||
KEYCLOAK_ID=
|
KEYCLOAK_ID=
|
||||||
KEYCLOAK_SECRET=
|
KEYCLOAK_SECRET=
|
||||||
KEYCLOAK_ISSUER=
|
KEYCLOAK_ISSUER=
|
||||||
|
|
||||||
LINE_ID=
|
IDS4_ID=
|
||||||
LINE_SECRET=
|
IDS4_SECRET=
|
||||||
|
IDS4_ISSUER=
|
||||||
|
|
||||||
TRAKT_ID=
|
GITHUB_ID=
|
||||||
TRAKT_SECRET=
|
GITHUB_SECRET=
|
||||||
|
|
||||||
TWITCH_ID=
|
TWITCH_ID=
|
||||||
TWITCH_SECRET=
|
TWITCH_SECRET=
|
||||||
@@ -49,8 +30,11 @@ TWITCH_SECRET=
|
|||||||
TWITTER_ID=
|
TWITTER_ID=
|
||||||
TWITTER_SECRET=
|
TWITTER_SECRET=
|
||||||
|
|
||||||
WIKIMEDIA_ID=
|
LINE_ID=
|
||||||
WIKIMEDIA_SECRET=
|
LINE_SECRET=
|
||||||
|
|
||||||
|
TRAKT_ID=
|
||||||
|
TRAKT_SECRET=
|
||||||
|
|
||||||
# Example configuration for a Gmail account (will need SMTP enabled)
|
# Example configuration for a Gmail account (will need SMTP enabled)
|
||||||
EMAIL_SERVER=smtps://user@gmail.com:password@smtp.gmail.com:465
|
EMAIL_SERVER=smtps://user@gmail.com:password@smtp.gmail.com:465
|
||||||
@@ -63,9 +47,12 @@ EMAIL_FROM=user@gmail.com
|
|||||||
# MongoDB: DATABASE_URL=mongodb://nextauth:password@127.0.0.1:27017/nextauth?synchronize=true
|
# MongoDB: DATABASE_URL=mongodb://nextauth:password@127.0.0.1:27017/nextauth?synchronize=true
|
||||||
DATABASE_URL=
|
DATABASE_URL=
|
||||||
|
|
||||||
|
WIKIMEDIA_ID=
|
||||||
|
WIKIMEDIA_SECRET=
|
||||||
|
|
||||||
# Supabase Example Configuration
|
# Supabase Example Configuration
|
||||||
# Supabase Example Configuration
|
# Supabase Example Configuration
|
||||||
# NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
|
# NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
|
||||||
# SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSJ9.vI9obAHOGyVVKa3pD--kJlyxp-Z2zV9UUMAhKpNLAcU
|
# SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSJ9.vI9obAHOGyVVKa3pD--kJlyxp-Z2zV9UUMAhKpNLAcU
|
||||||
# SUPABASE_JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long
|
# SUPABASE_JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long
|
||||||
# NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs
|
# NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24ifQ.625_WdcF3KHqz5amU0x2X5WWHP-OEs_4qj0ssLNHzTs
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:
|
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:
|
||||||
|
|
||||||
[Setting up local environment
|
[Setting up local environment
|
||||||
](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md#setting-up-local-environment)
|
](https://github.com/nextauthjs/next-auth/blob/main/CONTRIBUTING.md#setting-up-local-environment)
|
||||||
220
apps/dev/app/api/auth/[...nextauth]/route.ts
Normal file
220
apps/dev/app/api/auth/[...nextauth]/route.ts
Normal file
@@ -0,0 +1,220 @@
|
|||||||
|
import NextAuth, { type NextAuthOptions } from "next-auth"
|
||||||
|
// import { NextRequest } from "next/server"
|
||||||
|
|
||||||
|
// Providers
|
||||||
|
import Apple from "next-auth/providers/apple"
|
||||||
|
import Auth0 from "next-auth/providers/auth0"
|
||||||
|
import AzureAD from "next-auth/providers/azure-ad"
|
||||||
|
import AzureB2C from "next-auth/providers/azure-ad-b2c"
|
||||||
|
import BoxyHQSAML from "next-auth/providers/boxyhq-saml"
|
||||||
|
// import Cognito from "next-auth/providers/cognito"
|
||||||
|
import Credentials from "next-auth/providers/credentials"
|
||||||
|
import Discord from "next-auth/providers/discord"
|
||||||
|
import DuendeIDS6 from "next-auth/providers/duende-identity-server6"
|
||||||
|
// import Email from "next-auth/providers/email"
|
||||||
|
import Facebook from "next-auth/providers/facebook"
|
||||||
|
import Foursquare from "next-auth/providers/foursquare"
|
||||||
|
import Freshbooks from "next-auth/providers/freshbooks"
|
||||||
|
import GitHub from "next-auth/providers/github"
|
||||||
|
import Gitlab from "next-auth/providers/gitlab"
|
||||||
|
import Google from "next-auth/providers/google"
|
||||||
|
// import IDS4 from "next-auth/providers/identity-server4"
|
||||||
|
import Instagram from "next-auth/providers/instagram"
|
||||||
|
// import Keycloak from "next-auth/providers/keycloak"
|
||||||
|
import Line from "next-auth/providers/line"
|
||||||
|
import LinkedIn from "next-auth/providers/linkedin"
|
||||||
|
import Mailchimp from "next-auth/providers/mailchimp"
|
||||||
|
// import Okta from "next-auth/providers/okta"
|
||||||
|
import Osu from "next-auth/providers/osu"
|
||||||
|
import Patreon from "next-auth/providers/patreon"
|
||||||
|
import Slack from "next-auth/providers/slack"
|
||||||
|
import Spotify from "next-auth/providers/spotify"
|
||||||
|
import Trakt from "next-auth/providers/trakt"
|
||||||
|
import Twitch from "next-auth/providers/twitch"
|
||||||
|
import Twitter from "next-auth/providers/twitter"
|
||||||
|
import Vk from "next-auth/providers/vk"
|
||||||
|
import Wikimedia from "next-auth/providers/wikimedia"
|
||||||
|
import WorkOS from "next-auth/providers/workos"
|
||||||
|
|
||||||
|
// // Prisma
|
||||||
|
// import { PrismaClient } from "@prisma/client"
|
||||||
|
// import { PrismaAdapter } from "@next-auth/prisma-adapter"
|
||||||
|
// const client = globalThis.prisma || new PrismaClient()
|
||||||
|
// if (process.env.NODE_ENV !== "production") globalThis.prisma = client
|
||||||
|
// const adapter = PrismaAdapter(client)
|
||||||
|
|
||||||
|
// // Fauna
|
||||||
|
// import { Client as FaunaClient } from "faunadb"
|
||||||
|
// import { FaunaAdapter } from "@next-auth/fauna-adapter"
|
||||||
|
// const opts = { secret: process.env.FAUNA_SECRET, domain: process.env.FAUNA_DOMAIN }
|
||||||
|
// const client = globalThis.fauna || new FaunaClient(opts)
|
||||||
|
// if (process.env.NODE_ENV !== "production") globalThis.fauna = client
|
||||||
|
// const adapter = FaunaAdapter(client)
|
||||||
|
|
||||||
|
// // TypeORM
|
||||||
|
// import { TypeORMLegacyAdapter } from "@next-auth/typeorm-legacy-adapter"
|
||||||
|
// const adapter = TypeORMLegacyAdapter({
|
||||||
|
// type: "sqlite",
|
||||||
|
// name: "next-auth-test-memory",
|
||||||
|
// database: "./typeorm/dev.db",
|
||||||
|
// synchronize: true,
|
||||||
|
// })
|
||||||
|
|
||||||
|
// // Supabase
|
||||||
|
// import { SupabaseAdapter } from "@next-auth/supabase-adapter"
|
||||||
|
// const adapter = SupabaseAdapter({
|
||||||
|
// url: process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||||
|
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
|
||||||
|
// })
|
||||||
|
|
||||||
|
export const authOptions: NextAuthOptions = {
|
||||||
|
// adapter,
|
||||||
|
// debug: process.env.NODE_ENV !== "production",
|
||||||
|
theme: {
|
||||||
|
logo: "https://next-auth.js.org/img/logo/logo-sm.png",
|
||||||
|
brandColor: "#1786fb",
|
||||||
|
},
|
||||||
|
providers: [
|
||||||
|
Credentials({
|
||||||
|
credentials: { password: { label: "Password", type: "password" } },
|
||||||
|
async authorize(credentials) {
|
||||||
|
if (credentials.password !== "pw") return null
|
||||||
|
return {
|
||||||
|
name: "Fill Murray",
|
||||||
|
email: "bill@fillmurray.com",
|
||||||
|
image: "https://www.fillmurray.com/64/64",
|
||||||
|
id: "1",
|
||||||
|
foo: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
Apple({
|
||||||
|
clientId: process.env.APPLE_ID,
|
||||||
|
clientSecret: process.env.APPLE_SECRET,
|
||||||
|
}),
|
||||||
|
Auth0({
|
||||||
|
clientId: process.env.AUTH0_ID,
|
||||||
|
clientSecret: process.env.AUTH0_SECRET,
|
||||||
|
issuer: process.env.AUTH0_ISSUER,
|
||||||
|
}),
|
||||||
|
AzureAD({
|
||||||
|
clientId: process.env.AZURE_AD_CLIENT_ID,
|
||||||
|
clientSecret: process.env.AZURE_AD_CLIENT_SECRET,
|
||||||
|
tenantId: process.env.AZURE_AD_TENANT_ID,
|
||||||
|
}),
|
||||||
|
AzureB2C({
|
||||||
|
clientId: process.env.AZURE_B2C_ID,
|
||||||
|
clientSecret: process.env.AZURE_B2C_SECRET,
|
||||||
|
issuer: process.env.AZURE_B2C_ISSUER,
|
||||||
|
}),
|
||||||
|
BoxyHQSAML({
|
||||||
|
issuer: "https://jackson-demo.boxyhq.com",
|
||||||
|
clientId: "tenant=boxyhq.com&product=saml-demo.boxyhq.com",
|
||||||
|
clientSecret: "dummy",
|
||||||
|
}),
|
||||||
|
// Cognito({ clientId: process.env.COGNITO_ID, clientSecret: process.env.COGNITO_SECRET, issuer: process.env.COGNITO_ISSUER }),
|
||||||
|
Discord({
|
||||||
|
clientId: process.env.DISCORD_ID,
|
||||||
|
clientSecret: process.env.DISCORD_SECRET,
|
||||||
|
}),
|
||||||
|
DuendeIDS6({
|
||||||
|
clientId: "interactive.confidential",
|
||||||
|
clientSecret: "secret",
|
||||||
|
issuer: "https://demo.duendesoftware.com",
|
||||||
|
}),
|
||||||
|
Facebook({
|
||||||
|
clientId: process.env.FACEBOOK_ID,
|
||||||
|
clientSecret: process.env.FACEBOOK_SECRET,
|
||||||
|
}),
|
||||||
|
Foursquare({
|
||||||
|
clientId: process.env.FOURSQUARE_ID,
|
||||||
|
clientSecret: process.env.FOURSQUARE_SECRET,
|
||||||
|
}),
|
||||||
|
Freshbooks({
|
||||||
|
clientId: process.env.FRESHBOOKS_ID,
|
||||||
|
clientSecret: process.env.FRESHBOOKS_SECRET,
|
||||||
|
}),
|
||||||
|
GitHub({
|
||||||
|
clientId: process.env.GITHUB_ID,
|
||||||
|
clientSecret: process.env.GITHUB_SECRET,
|
||||||
|
}),
|
||||||
|
Gitlab({
|
||||||
|
clientId: process.env.GITLAB_ID,
|
||||||
|
clientSecret: process.env.GITLAB_SECRET,
|
||||||
|
}),
|
||||||
|
Google({
|
||||||
|
clientId: process.env.GOOGLE_ID,
|
||||||
|
clientSecret: process.env.GOOGLE_SECRET,
|
||||||
|
}),
|
||||||
|
// IDS4({ clientId: process.env.IDS4_ID, clientSecret: process.env.IDS4_SECRET, issuer: process.env.IDS4_ISSUER }),
|
||||||
|
Instagram({
|
||||||
|
clientId: process.env.INSTAGRAM_ID,
|
||||||
|
clientSecret: process.env.INSTAGRAM_SECRET,
|
||||||
|
}),
|
||||||
|
// Keycloak({ clientId: process.env.KEYCLOAK_ID, clientSecret: process.env.KEYCLOAK_SECRET, issuer: process.env.KEYCLOAK_ISSUER }),
|
||||||
|
Line({
|
||||||
|
clientId: process.env.LINE_ID,
|
||||||
|
clientSecret: process.env.LINE_SECRET,
|
||||||
|
}),
|
||||||
|
LinkedIn({
|
||||||
|
clientId: process.env.LINKEDIN_ID,
|
||||||
|
clientSecret: process.env.LINKEDIN_SECRET,
|
||||||
|
}),
|
||||||
|
Mailchimp({
|
||||||
|
clientId: process.env.MAILCHIMP_ID,
|
||||||
|
clientSecret: process.env.MAILCHIMP_SECRET,
|
||||||
|
}),
|
||||||
|
// Okta({ clientId: process.env.OKTA_ID, clientSecret: process.env.OKTA_SECRET, issuer: process.env.OKTA_ISSUER }),
|
||||||
|
Osu({
|
||||||
|
clientId: process.env.OSU_CLIENT_ID,
|
||||||
|
clientSecret: process.env.OSU_CLIENT_SECRET,
|
||||||
|
}),
|
||||||
|
Patreon({
|
||||||
|
clientId: process.env.PATREON_ID,
|
||||||
|
clientSecret: process.env.PATREON_SECRET,
|
||||||
|
}),
|
||||||
|
Slack({
|
||||||
|
clientId: process.env.SLACK_ID,
|
||||||
|
clientSecret: process.env.SLACK_SECRET,
|
||||||
|
}),
|
||||||
|
Spotify({
|
||||||
|
clientId: process.env.SPOTIFY_ID,
|
||||||
|
clientSecret: process.env.SPOTIFY_SECRET,
|
||||||
|
}),
|
||||||
|
Trakt({
|
||||||
|
clientId: process.env.TRAKT_ID,
|
||||||
|
clientSecret: process.env.TRAKT_SECRET,
|
||||||
|
}),
|
||||||
|
Twitch({
|
||||||
|
clientId: process.env.TWITCH_ID,
|
||||||
|
clientSecret: process.env.TWITCH_SECRET,
|
||||||
|
}),
|
||||||
|
Twitter({
|
||||||
|
clientId: process.env.TWITTER_ID,
|
||||||
|
clientSecret: process.env.TWITTER_SECRET,
|
||||||
|
}),
|
||||||
|
// TwitterLegacy({ clientId: process.env.TWITTER_LEGACY_ID, clientSecret: process.env.TWITTER_LEGACY_SECRET }),
|
||||||
|
Vk({ clientId: process.env.VK_ID, clientSecret: process.env.VK_SECRET }),
|
||||||
|
Wikimedia({
|
||||||
|
clientId: process.env.WIKIMEDIA_ID,
|
||||||
|
clientSecret: process.env.WIKIMEDIA_SECRET,
|
||||||
|
}),
|
||||||
|
WorkOS({
|
||||||
|
clientId: process.env.WORKOS_ID,
|
||||||
|
clientSecret: process.env.WORKOS_SECRET,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Advanced Initialization - route handler
|
||||||
|
*/
|
||||||
|
// const handler = async (
|
||||||
|
// req: NextRequest,
|
||||||
|
// routeContext: { params: { nextauth: string[] } }
|
||||||
|
// ): Promise<any> => {
|
||||||
|
// return NextAuth(req, routeContext, authOptions)
|
||||||
|
// }
|
||||||
|
|
||||||
|
const handler = NextAuth(authOptions)
|
||||||
|
export { handler as GET, handler as POST }
|
||||||
6
apps/dev/app/server-component/page.tsx
Normal file
6
apps/dev/app/server-component/page.tsx
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { getServerSession } from "next-auth/next"
|
||||||
|
|
||||||
|
export default async function Page() {
|
||||||
|
const session = await getServerSession()
|
||||||
|
return <pre>{JSON.stringify(session, null, 2)}</pre>
|
||||||
|
}
|
||||||
@@ -8,10 +8,10 @@ export default function Footer() {
|
|||||||
<hr />
|
<hr />
|
||||||
<ul className={styles.navItems}>
|
<ul className={styles.navItems}>
|
||||||
<li className={styles.navItem}>
|
<li className={styles.navItem}>
|
||||||
<a href="https://authjs.dev">Documentation</a>
|
<a href="https://next-auth.js.org">Documentation</a>
|
||||||
</li>
|
</li>
|
||||||
<li className={styles.navItem}>
|
<li className={styles.navItem}>
|
||||||
<a href="https://www.npmjs.com/package/@auth/core">NPM</a>
|
<a href="https://www.npmjs.com/package/next-auth">NPM</a>
|
||||||
</li>
|
</li>
|
||||||
<li className={styles.navItem}>
|
<li className={styles.navItem}>
|
||||||
<a href="https://github.com/nextauthjs/next-auth-example">GitHub</a>
|
<a href="https://github.com/nextauthjs/next-auth-example">GitHub</a>
|
||||||
@@ -11,4 +11,4 @@
|
|||||||
.navItem {
|
.navItem {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { useSession } from "next-auth/react"
|
import { signIn, signOut, useSession } from "next-auth/react"
|
||||||
import styles from "./header.module.css"
|
import styles from "./header.module.css"
|
||||||
|
|
||||||
// The approach used in this component shows how to built a sign in and sign out
|
// The approach used in this component shows how to built a sign in and sign out
|
||||||
@@ -24,7 +24,14 @@ export default function Header() {
|
|||||||
<span className={styles.notSignedInText}>
|
<span className={styles.notSignedInText}>
|
||||||
You are not signed in
|
You are not signed in
|
||||||
</span>
|
</span>
|
||||||
<a href="/api/auth/signin" className={styles.buttonPrimary}>
|
<a
|
||||||
|
href="/api/auth/signin"
|
||||||
|
className={styles.buttonPrimary}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
signIn()
|
||||||
|
}}
|
||||||
|
>
|
||||||
Sign in
|
Sign in
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
@@ -40,7 +47,14 @@ export default function Header() {
|
|||||||
<strong>{session.user.email} </strong>
|
<strong>{session.user.email} </strong>
|
||||||
{session.user.name ? `(${session.user.name})` : null}
|
{session.user.name ? `(${session.user.name})` : null}
|
||||||
</span>
|
</span>
|
||||||
<a href="/api/auth/signout" className={styles.button}>
|
<a
|
||||||
|
href="/api/auth/signout"
|
||||||
|
className={styles.button}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
signOut()
|
||||||
|
}}
|
||||||
|
>
|
||||||
Sign out
|
Sign out
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
@@ -11,10 +11,10 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 0 0 0.6rem 0.6rem;
|
border-radius: 0 0 .6rem .6rem;
|
||||||
padding: 0.6rem 1rem;
|
padding: .6rem 1rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
background-color: rgba(0,0,0,.05);
|
||||||
transition: all 0.2s ease-in;
|
transition: all 0.2s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,13 +26,13 @@
|
|||||||
.signedInText,
|
.signedInText,
|
||||||
.notSignedInText {
|
.notSignedInText {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
padding-top: 0.8rem;
|
padding-top: .8rem;
|
||||||
left: 1rem;
|
left: 1rem;
|
||||||
right: 6.5rem;
|
right: 6.5rem;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: inherit;
|
display: inherit;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
line-height: 1.3rem;
|
line-height: 1.3rem;
|
||||||
}
|
}
|
||||||
@@ -55,13 +55,13 @@
|
|||||||
.button,
|
.button,
|
||||||
.buttonPrimary {
|
.buttonPrimary {
|
||||||
float: right;
|
float: right;
|
||||||
margin-right: -0.4rem;
|
margin-right: -.4rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
border-radius: 0.3rem;
|
border-radius: .3rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
line-height: 1.4rem;
|
line-height: 1.4rem;
|
||||||
padding: 0.7rem 0.8rem;
|
padding: .7rem .8rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
@@ -73,11 +73,11 @@
|
|||||||
border-color: #346df1;
|
border-color: #346df1;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding: 0.7rem 1.4rem;
|
padding: .7rem 1.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttonPrimary:hover {
|
.buttonPrimary:hover {
|
||||||
box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.2);
|
box-shadow: inset 0 0 5rem rgba(0,0,0,0.2)
|
||||||
}
|
}
|
||||||
|
|
||||||
.navItems {
|
.navItems {
|
||||||
@@ -89,4 +89,4 @@
|
|||||||
.navItem {
|
.navItem {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
14
apps/dev/components/layout.js
Normal file
14
apps/dev/components/layout.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import Header from 'components/header'
|
||||||
|
import Footer from 'components/footer'
|
||||||
|
|
||||||
|
export default function Layout ({ children }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Header />
|
||||||
|
<main>
|
||||||
|
{children}
|
||||||
|
</main>
|
||||||
|
<Footer />
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
6
apps/dev/next-env.d.ts
vendored
Normal file
6
apps/dev/next-env.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/// <reference types="next" />
|
||||||
|
/// <reference types="next/image-types/global" />
|
||||||
|
/// <reference types="next/navigation-types/compat/navigation" />
|
||||||
|
|
||||||
|
// NOTE: This file should not be edited
|
||||||
|
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||||
4
apps/dev/nextjs/.gitignore
vendored
4
apps/dev/nextjs/.gitignore
vendored
@@ -1,4 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
/test-results/
|
|
||||||
/playwright-report/
|
|
||||||
/playwright/.cache/
|
|
||||||
4
apps/dev/nextjs/.vscode/settings.json
vendored
4
apps/dev/nextjs/.vscode/settings.json
vendored
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"typescript.tsdk": "../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib",
|
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import { unstable_getServerSession } from "next-auth/next"
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
const session = await unstable_getServerSession()
|
|
||||||
return <pre>{JSON.stringify(session, null, 2)}</pre>
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import Header from "components/header"
|
|
||||||
import Footer from "components/footer"
|
|
||||||
|
|
||||||
export default function Layout({ children }) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Header />
|
|
||||||
<main>{children}</main>
|
|
||||||
<Footer />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import Layout from "../components/layout"
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return (
|
|
||||||
<Layout>
|
|
||||||
<h1>Client Side Rendering</h1>
|
|
||||||
<p>
|
|
||||||
This page uses the <strong>useSession()</strong> React Hook in the{" "}
|
|
||||||
<strong></Header></strong> component.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The <strong>useSession()</strong> React Hook easy to use and allows
|
|
||||||
pages to render very quickly.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The advantage of this approach is that session state is shared between
|
|
||||||
pages by using the <strong>Provider</strong> in <strong>_app.js</strong>{" "}
|
|
||||||
so that navigation between pages using <strong>useSession()</strong> is
|
|
||||||
very fast.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The disadvantage of <strong>useSession()</strong> is that it requires
|
|
||||||
client side JavaScript.
|
|
||||||
</p>
|
|
||||||
</Layout>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
import Layout from "components/layout"
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return (
|
|
||||||
<Layout>
|
|
||||||
<h1>NextAuth.js Example</h1>
|
|
||||||
<p>
|
|
||||||
This is an example site to demonstrate how to use{" "}
|
|
||||||
<a href="https://authjs.dev">NextAuth.js</a> for authentication.
|
|
||||||
</p>
|
|
||||||
</Layout>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
import Layout from "../components/layout"
|
|
||||||
|
|
||||||
export default function Page() {
|
|
||||||
return (
|
|
||||||
<Layout>
|
|
||||||
<p>
|
|
||||||
This is an example site to demonstrate how to use{" "}
|
|
||||||
<a href="https://authjs.dev">Auth.js</a> for authentication.
|
|
||||||
</p>
|
|
||||||
<h2>Terms of Service</h2>
|
|
||||||
<p>
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
||||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
||||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
||||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
</p>
|
|
||||||
<h2>Privacy Policy</h2>
|
|
||||||
<p>
|
|
||||||
This site uses JSON Web Tokens and an in-memory database which resets
|
|
||||||
every ~2 hours.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Data provided to this site is exclusively used to support signing in and
|
|
||||||
is not passed to any third party services, other than via SMTP or OAuth
|
|
||||||
for the purposes of authentication.
|
|
||||||
</p>
|
|
||||||
</Layout>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
import type { PlaywrightTestConfig } from '@playwright/test';
|
|
||||||
import { devices } from '@playwright/test';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Read environment variables from file.
|
|
||||||
* https://github.com/motdotla/dotenv
|
|
||||||
*/
|
|
||||||
require('dotenv').config();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* See https://playwright.dev/docs/test-configuration.
|
|
||||||
*/
|
|
||||||
const config: PlaywrightTestConfig = {
|
|
||||||
testDir: './tests',
|
|
||||||
/* Maximum time one test can run for. */
|
|
||||||
timeout: 30 * 1000,
|
|
||||||
expect: {
|
|
||||||
/**
|
|
||||||
* Maximum time expect() should wait for the condition to be met.
|
|
||||||
* For example in `await expect(locator).toHaveText();`
|
|
||||||
*/
|
|
||||||
timeout: 5000
|
|
||||||
},
|
|
||||||
/* Run tests in files in parallel */
|
|
||||||
fullyParallel: true,
|
|
||||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
||||||
forbidOnly: !!process.env.CI,
|
|
||||||
/* Retry on CI only */
|
|
||||||
retries: process.env.CI ? 2 : 0,
|
|
||||||
/* Opt out of parallel tests on CI. */
|
|
||||||
workers: process.env.CI ? 1 : undefined,
|
|
||||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
||||||
reporter: 'html',
|
|
||||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
||||||
use: {
|
|
||||||
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
|
|
||||||
actionTimeout: 0,
|
|
||||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
|
||||||
// baseURL: 'http://localhost:3000',
|
|
||||||
|
|
||||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
||||||
trace: 'on-first-retry',
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Configure projects for major browsers */
|
|
||||||
projects: [
|
|
||||||
{
|
|
||||||
name: 'chromium',
|
|
||||||
use: {
|
|
||||||
...devices['Desktop Chrome'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'firefox',
|
|
||||||
use: {
|
|
||||||
...devices['Desktop Firefox'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: 'webkit',
|
|
||||||
use: {
|
|
||||||
...devices['Desktop Safari'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Test against mobile viewports. */
|
|
||||||
// {
|
|
||||||
// name: 'Mobile Chrome',
|
|
||||||
// use: {
|
|
||||||
// ...devices['Pixel 5'],
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: 'Mobile Safari',
|
|
||||||
// use: {
|
|
||||||
// ...devices['iPhone 12'],
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
|
|
||||||
/* Test against branded browsers. */
|
|
||||||
// {
|
|
||||||
// name: 'Microsoft Edge',
|
|
||||||
// use: {
|
|
||||||
// channel: 'msedge',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// name: 'Google Chrome',
|
|
||||||
// use: {
|
|
||||||
// channel: 'chrome',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
|
|
||||||
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
|
|
||||||
// outputDir: 'test-results/',
|
|
||||||
|
|
||||||
/* Run your local dev server before starting the tests */
|
|
||||||
// webServer: {
|
|
||||||
// command: 'npm run start',
|
|
||||||
// port: 3000,
|
|
||||||
// },
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import { test, expect } from "@playwright/test"
|
|
||||||
|
|
||||||
test("Sign in with Auth0", async ({ page }) => {
|
|
||||||
// Go to NextAuth example app
|
|
||||||
await page.goto("https://next-auth-example.vercel.app")
|
|
||||||
|
|
||||||
// Click 'Sign In'
|
|
||||||
await page.click("#__next > header > div > p > a")
|
|
||||||
|
|
||||||
// Auth0 Login Provider
|
|
||||||
await page.click('body > div > div form[action*="auth0"] > button')
|
|
||||||
|
|
||||||
// Enter Credentials (Username/Password Login) on Auth0 Widget
|
|
||||||
await page.type("#username", process.env.AUTH0_USERNAME!)
|
|
||||||
await page.type("#password", process.env.AUTH0_PASSWORD!)
|
|
||||||
|
|
||||||
// Snap a screenshot
|
|
||||||
// await page.screenshot({ path: "1-auth0-login.png", fullPage: true })
|
|
||||||
|
|
||||||
// Press submit on Auth0 form
|
|
||||||
await page.click('body > div > main > section > div button[type="submit"]')
|
|
||||||
|
|
||||||
// Wait for next-auth example page login status header to appear
|
|
||||||
await page.waitForTimeout(2000)
|
|
||||||
|
|
||||||
// Snap a screenshot
|
|
||||||
// await page.screenshot({
|
|
||||||
// path: "2-next-auth-redirect-result.png",
|
|
||||||
// fullPage: false,
|
|
||||||
// })
|
|
||||||
|
|
||||||
// Check session object after successful login
|
|
||||||
const response = await page.goto(
|
|
||||||
"https://next-auth-example.vercel.app/api/auth/session"
|
|
||||||
)
|
|
||||||
const session = await response?.json()
|
|
||||||
expect(session?.user?.email).toBe(process.env.AUTH0_USERNAME)
|
|
||||||
// TODO: Check whole object with .toEqual()
|
|
||||||
})
|
|
||||||
@@ -1,20 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "next-auth-app",
|
"name": "next-auth-app",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Next.js + Auth.js Developer app",
|
"description": "NextAuth.js Developer app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .next",
|
"clean": "rm -rf .next",
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
"lint": "next lint",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"email": "fake-smtp-server",
|
"email": "fake-smtp-server",
|
||||||
"start:email": "pnpm email",
|
"start:email": "pnpm email"
|
||||||
"e2e": "pnpm dlx playwright test"
|
|
||||||
},
|
},
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/core": "workspace:*",
|
|
||||||
"@next-auth/fauna-adapter": "workspace:*",
|
"@next-auth/fauna-adapter": "workspace:*",
|
||||||
"@next-auth/prisma-adapter": "workspace:*",
|
"@next-auth/prisma-adapter": "workspace:*",
|
||||||
"@next-auth/supabase-adapter": "workspace:*",
|
"@next-auth/supabase-adapter": "workspace:*",
|
||||||
@@ -22,18 +21,16 @@
|
|||||||
"@prisma/client": "^3",
|
"@prisma/client": "^3",
|
||||||
"@supabase/supabase-js": "^2.0.5",
|
"@supabase/supabase-js": "^2.0.5",
|
||||||
"faunadb": "^4",
|
"faunadb": "^4",
|
||||||
"next": "13.1.1",
|
"next": "13.4.12",
|
||||||
"next-auth": "workspace:*",
|
"next-auth": "workspace:*",
|
||||||
"nodemailer": "^6",
|
"nodemailer": "^6",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
"react-dom": "^18"
|
"react-dom": "^18"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@playwright/test": "1.29.2",
|
|
||||||
"@types/jsonwebtoken": "^8.5.5",
|
"@types/jsonwebtoken": "^8.5.5",
|
||||||
"@types/react": "^18.0.15",
|
"@types/react": "^18.0.37",
|
||||||
"@types/react-dom": "^18.0.6",
|
"@types/react-dom": "^18.0.6",
|
||||||
"dotenv": "^16.0.3",
|
|
||||||
"fake-smtp-server": "^0.8.0",
|
"fake-smtp-server": "^0.8.0",
|
||||||
"pg": "^8.7.3",
|
"pg": "^8.7.3",
|
||||||
"prisma": "^3",
|
"prisma": "^3",
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
import Layout from "../components/layout"
|
import Layout from '../components/layout'
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page () {
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<h1>API Example</h1>
|
<h1>API Example</h1>
|
||||||
<p>The examples below show responses from the example API endpoints.</p>
|
<p>The examples below show responses from the example API endpoints.</p>
|
||||||
<p>
|
<p><em>You must be signed in to see responses.</em></p>
|
||||||
<em>You must be signed in to see responses.</em>
|
|
||||||
</p>
|
|
||||||
<h2>Session</h2>
|
<h2>Session</h2>
|
||||||
<p>/api/examples/session</p>
|
<p>/api/examples/session</p>
|
||||||
<iframe src="/api/examples/session" />
|
<iframe src='/api/examples/session' />
|
||||||
<h2>JSON Web Token</h2>
|
<h2>JSON Web Token</h2>
|
||||||
<p>/api/examples/jwt</p>
|
<p>/api/examples/jwt</p>
|
||||||
<iframe src="/api/examples/jwt" />
|
<iframe src='/api/examples/jwt' />
|
||||||
</Layout>
|
</Layout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -1,42 +1,39 @@
|
|||||||
import { Auth, type AuthConfig } from "@auth/core"
|
import NextAuth, { NextAuthOptions } from "next-auth"
|
||||||
|
|
||||||
// Providers
|
// Providers
|
||||||
import Apple from "@auth/core/providers/apple"
|
import Apple from "next-auth/providers/apple"
|
||||||
import Asgardeo from "@auth/core/providers/asgardeo"
|
import Auth0 from "next-auth/providers/auth0"
|
||||||
import Auth0 from "@auth/core/providers/auth0"
|
import AzureAD from "next-auth/providers/azure-ad"
|
||||||
import AzureAD from "@auth/core/providers/azure-ad"
|
import AzureB2C from "next-auth/providers/azure-ad-b2c"
|
||||||
import AzureB2C from "@auth/core/providers/azure-ad-b2c"
|
import BoxyHQSAML from "next-auth/providers/boxyhq-saml"
|
||||||
import BeyondIdentity from "@auth/core/providers/beyondidentity"
|
// import Cognito from "next-auth/providers/cognito"
|
||||||
import BoxyHQSAML from "@auth/core/providers/boxyhq-saml"
|
import Credentials from "next-auth/providers/credentials"
|
||||||
// import Cognito from "@auth/core/providers/cognito"
|
import Discord from "next-auth/providers/discord"
|
||||||
import Credentials from "@auth/core/providers/credentials"
|
import DuendeIDS6 from "next-auth/providers/duende-identity-server6"
|
||||||
import Discord from "@auth/core/providers/discord"
|
// import Email from "next-auth/providers/email"
|
||||||
import DuendeIDS6 from "@auth/core/providers/duende-identity-server6"
|
import Facebook from "next-auth/providers/facebook"
|
||||||
// import Email from "@auth/core/providers/email"
|
import Foursquare from "next-auth/providers/foursquare"
|
||||||
import Facebook from "@auth/core/providers/facebook"
|
import Freshbooks from "next-auth/providers/freshbooks"
|
||||||
import Foursquare from "@auth/core/providers/foursquare"
|
import GitHub from "next-auth/providers/github"
|
||||||
import Freshbooks from "@auth/core/providers/freshbooks"
|
import Gitlab from "next-auth/providers/gitlab"
|
||||||
import GitHub from "@auth/core/providers/github"
|
import Google from "next-auth/providers/google"
|
||||||
import Gitlab from "@auth/core/providers/gitlab"
|
// import IDS4 from "next-auth/providers/identity-server4"
|
||||||
import Google from "@auth/core/providers/google"
|
import Instagram from "next-auth/providers/instagram"
|
||||||
// import IDS4 from "@auth/core/providers/identity-server4"
|
// import Keycloak from "next-auth/providers/keycloak"
|
||||||
import Instagram from "@auth/core/providers/instagram"
|
import Line from "next-auth/providers/line"
|
||||||
// import Keycloak from "@auth/core/providers/keycloak"
|
import LinkedIn from "next-auth/providers/linkedin"
|
||||||
import Line from "@auth/core/providers/line"
|
import Mailchimp from "next-auth/providers/mailchimp"
|
||||||
import LinkedIn from "@auth/core/providers/linkedin"
|
// import Okta from "next-auth/providers/okta"
|
||||||
import Mailchimp from "@auth/core/providers/mailchimp"
|
import Osu from "next-auth/providers/osu"
|
||||||
import Notion from "@auth/core/providers/notion"
|
import Patreon from "next-auth/providers/patreon"
|
||||||
// import Okta from "@auth/core/providers/okta"
|
import Slack from "next-auth/providers/slack"
|
||||||
import Osu from "@auth/core/providers/osu"
|
import Spotify from "next-auth/providers/spotify"
|
||||||
import Patreon from "@auth/core/providers/patreon"
|
import Trakt from "next-auth/providers/trakt"
|
||||||
import Slack from "@auth/core/providers/slack"
|
import Twitch from "next-auth/providers/twitch"
|
||||||
import Spotify from "@auth/core/providers/spotify"
|
import Twitter from "next-auth/providers/twitter"
|
||||||
import Trakt from "@auth/core/providers/trakt"
|
import Vk from "next-auth/providers/vk"
|
||||||
import Twitch from "@auth/core/providers/twitch"
|
import Wikimedia from "next-auth/providers/wikimedia"
|
||||||
import Twitter from "@auth/core/providers/twitter"
|
import WorkOS from "next-auth/providers/workos"
|
||||||
import Vk from "@auth/core/providers/vk"
|
|
||||||
import Wikimedia from "@auth/core/providers/wikimedia"
|
|
||||||
import WorkOS from "@auth/core/providers/workos"
|
|
||||||
|
|
||||||
// // Prisma
|
// // Prisma
|
||||||
// import { PrismaClient } from "@prisma/client"
|
// import { PrismaClient } from "@prisma/client"
|
||||||
@@ -69,9 +66,9 @@ import WorkOS from "@auth/core/providers/workos"
|
|||||||
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
|
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
|
||||||
// })
|
// })
|
||||||
|
|
||||||
export const authConfig: AuthConfig = {
|
export const authOptions: NextAuthOptions = {
|
||||||
// adapter,
|
// adapter,
|
||||||
debug: process.env.NODE_ENV !== "production",
|
// debug: process.env.NODE_ENV !== "production",
|
||||||
theme: {
|
theme: {
|
||||||
logo: "https://next-auth.js.org/img/logo/logo-sm.png",
|
logo: "https://next-auth.js.org/img/logo/logo-sm.png",
|
||||||
brandColor: "#1786fb",
|
brandColor: "#1786fb",
|
||||||
@@ -85,7 +82,6 @@ export const authConfig: AuthConfig = {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
Apple({ clientId: process.env.APPLE_ID, clientSecret: process.env.APPLE_SECRET }),
|
Apple({ clientId: process.env.APPLE_ID, clientSecret: process.env.APPLE_SECRET }),
|
||||||
Asgardeo({ clientId: process.env.ASGARDEO_CLIENT_ID, clientSecret: process.env.ASGARDEO_CLIENT_SECRET, issuer: process.env.ASGARDEO_ISSUER }),
|
|
||||||
Auth0({ clientId: process.env.AUTH0_ID, clientSecret: process.env.AUTH0_SECRET, issuer: process.env.AUTH0_ISSUER }),
|
Auth0({ clientId: process.env.AUTH0_ID, clientSecret: process.env.AUTH0_SECRET, issuer: process.env.AUTH0_ISSUER }),
|
||||||
AzureAD({
|
AzureAD({
|
||||||
clientId: process.env.AZURE_AD_CLIENT_ID,
|
clientId: process.env.AZURE_AD_CLIENT_ID,
|
||||||
@@ -93,7 +89,6 @@ export const authConfig: AuthConfig = {
|
|||||||
tenantId: process.env.AZURE_AD_TENANT_ID,
|
tenantId: process.env.AZURE_AD_TENANT_ID,
|
||||||
}),
|
}),
|
||||||
AzureB2C({ clientId: process.env.AZURE_B2C_ID, clientSecret: process.env.AZURE_B2C_SECRET, issuer: process.env.AZURE_B2C_ISSUER }),
|
AzureB2C({ clientId: process.env.AZURE_B2C_ID, clientSecret: process.env.AZURE_B2C_SECRET, issuer: process.env.AZURE_B2C_ISSUER }),
|
||||||
BeyondIdentity({ clientId: process.env.BEYOND_IDENTITY_CLIENT_ID, clientSecret: process.env.BEYOND_IDENTITY_CLIENT_SECRET, issuer: process.env.BEYOND_IDENTITY_ISSUER }),
|
|
||||||
BoxyHQSAML({ issuer: "https://jackson-demo.boxyhq.com", clientId: "tenant=boxyhq.com&product=saml-demo.boxyhq.com", clientSecret: "dummy" }),
|
BoxyHQSAML({ issuer: "https://jackson-demo.boxyhq.com", clientId: "tenant=boxyhq.com&product=saml-demo.boxyhq.com", clientSecret: "dummy" }),
|
||||||
// Cognito({ clientId: process.env.COGNITO_ID, clientSecret: process.env.COGNITO_SECRET, issuer: process.env.COGNITO_ISSUER }),
|
// Cognito({ clientId: process.env.COGNITO_ID, clientSecret: process.env.COGNITO_SECRET, issuer: process.env.COGNITO_ISSUER }),
|
||||||
Discord({ clientId: process.env.DISCORD_ID, clientSecret: process.env.DISCORD_SECRET }),
|
Discord({ clientId: process.env.DISCORD_ID, clientSecret: process.env.DISCORD_SECRET }),
|
||||||
@@ -110,7 +105,6 @@ export const authConfig: AuthConfig = {
|
|||||||
Line({ clientId: process.env.LINE_ID, clientSecret: process.env.LINE_SECRET }),
|
Line({ clientId: process.env.LINE_ID, clientSecret: process.env.LINE_SECRET }),
|
||||||
LinkedIn({ clientId: process.env.LINKEDIN_ID, clientSecret: process.env.LINKEDIN_SECRET }),
|
LinkedIn({ clientId: process.env.LINKEDIN_ID, clientSecret: process.env.LINKEDIN_SECRET }),
|
||||||
Mailchimp({ clientId: process.env.MAILCHIMP_ID, clientSecret: process.env.MAILCHIMP_SECRET }),
|
Mailchimp({ clientId: process.env.MAILCHIMP_ID, clientSecret: process.env.MAILCHIMP_SECRET }),
|
||||||
Notion({ clientId: process.env.NOTION_ID, clientSecret: process.env.NOTION_SECRET, redirectUri: process.env.NOTION_REDIRECT_URI }),
|
|
||||||
// Okta({ clientId: process.env.OKTA_ID, clientSecret: process.env.OKTA_SECRET, issuer: process.env.OKTA_ISSUER }),
|
// Okta({ clientId: process.env.OKTA_ID, clientSecret: process.env.OKTA_SECRET, issuer: process.env.OKTA_ISSUER }),
|
||||||
Osu({ clientId: process.env.OSU_CLIENT_ID, clientSecret: process.env.OSU_CLIENT_SECRET }),
|
Osu({ clientId: process.env.OSU_CLIENT_ID, clientSecret: process.env.OSU_CLIENT_SECRET }),
|
||||||
Patreon({ clientId: process.env.PATREON_ID, clientSecret: process.env.PATREON_SECRET }),
|
Patreon({ clientId: process.env.PATREON_ID, clientSecret: process.env.PATREON_SECRET }),
|
||||||
@@ -124,10 +118,9 @@ export const authConfig: AuthConfig = {
|
|||||||
Wikimedia({ clientId: process.env.WIKIMEDIA_ID, clientSecret: process.env.WIKIMEDIA_SECRET }),
|
Wikimedia({ clientId: process.env.WIKIMEDIA_ID, clientSecret: process.env.WIKIMEDIA_SECRET }),
|
||||||
WorkOS({ clientId: process.env.WORKOS_ID, clientSecret: process.env.WORKOS_SECRET }),
|
WorkOS({ clientId: process.env.WORKOS_ID, clientSecret: process.env.WORKOS_SECRET }),
|
||||||
],
|
],
|
||||||
// debug: process.env.NODE_ENV !== "production",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authConfig.adapter) {
|
if (authOptions.adapter) {
|
||||||
// TODO:
|
// TODO:
|
||||||
// authOptions.providers.unshift(
|
// authOptions.providers.unshift(
|
||||||
// // NOTE: You can start a fake e-mail server with `pnpm email`
|
// // NOTE: You can start a fake e-mail server with `pnpm email`
|
||||||
@@ -136,22 +129,4 @@ if (authConfig.adapter) {
|
|||||||
// )
|
// )
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move to next-auth/edge
|
export default NextAuth(authOptions)
|
||||||
function AuthHandler(...args: any[]) {
|
|
||||||
const envSecret = process.env.AUTH_SECRET ?? process.env.NEXTAUTH_SECRET
|
|
||||||
const envTrustHost = !!(process.env.NEXTAUTH_URL ?? process.env.AUTH_TRUST_HOST ?? process.env.VERCEL ?? process.env.NODE_ENV !== "production")
|
|
||||||
if (args.length === 1) {
|
|
||||||
return async (req: Request) => {
|
|
||||||
args[0].secret ??= envSecret
|
|
||||||
args[0].trustHost ??= envTrustHost
|
|
||||||
return Auth(req, args[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
args[1].secret ??= envSecret
|
|
||||||
args[1].trustHost ??= envTrustHost
|
|
||||||
return Auth(args[0], args[1])
|
|
||||||
}
|
|
||||||
|
|
||||||
export default AuthHandler(authConfig)
|
|
||||||
|
|
||||||
export const config = { runtime: "experimental-edge" }
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
// This is an example of to protect an API route
|
// This is an example of to protect an API route
|
||||||
import { unstable_getServerSession } from "next-auth/next"
|
import { getServerSession } from "next-auth/next"
|
||||||
import { authOptions } from "../auth/[...nextauth]"
|
import { authOptions } from "../auth/[...nextauth]"
|
||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
const session = await unstable_getServerSession(req, res, authOptions)
|
const session = await getServerSession(req, res, authOptions)
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
res.send({
|
res.send({
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
// This is an example of how to access a session from an API route
|
// This is an example of how to access a session from an API route
|
||||||
import { unstable_getServerSession } from "next-auth/next"
|
import { getServerSession } from "next-auth/next"
|
||||||
import { authOptions } from "../auth/[...nextauth]"
|
import { authOptions } from "../auth/[...nextauth]"
|
||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
const session = await unstable_getServerSession(req, res, authOptions)
|
const session = await getServerSession(req, res, authOptions)
|
||||||
res.json(session)
|
res.json(session)
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
// This is an example of how to query data from Supabase with RLS.
|
// This is an example of how to query data from Supabase with RLS.
|
||||||
// Learn more about Row Levele Security (RLS): https://supabase.com/docs/guides/auth/row-level-security
|
// Learn more about Row Levele Security (RLS): https://supabase.com/docs/guides/auth/row-level-security
|
||||||
import { unstable_getServerSession } from "next-auth/next"
|
import { getServerSession } from "next-auth/next"
|
||||||
import { authOptions } from "../auth/[...nextauth]"
|
import { authOptions } from "../auth/[...nextauth]"
|
||||||
import { createClient } from "@supabase/supabase-js"
|
import { createClient } from "@supabase/supabase-js"
|
||||||
|
|
||||||
export default async (req, res) => {
|
export default async (req, res) => {
|
||||||
const session = await unstable_getServerSession(req, res, authOptions)
|
const session = await getServerSession(req, res, authOptions)
|
||||||
|
|
||||||
if (!session)
|
if (!session)
|
||||||
return res.send(JSON.stringify({ error: "No session!" }, null, 2))
|
return res.send(JSON.stringify({ error: "No session!" }, null, 2))
|
||||||
22
apps/dev/pages/client.js
Normal file
22
apps/dev/pages/client.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import Layout from '../components/layout'
|
||||||
|
|
||||||
|
export default function Page () {
|
||||||
|
return (
|
||||||
|
<Layout>
|
||||||
|
<h1>Client Side Rendering</h1>
|
||||||
|
<p>
|
||||||
|
This page uses the <strong>useSession()</strong> React Hook in the <strong></Header></strong> component.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The <strong>useSession()</strong> React Hook easy to use and allows pages to render very quickly.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The advantage of this approach is that session state is shared between pages by using the <strong>Provider</strong> in <strong>_app.js</strong> so
|
||||||
|
that navigation between pages using <strong>useSession()</strong> is very fast.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
The disadvantage of <strong>useSession()</strong> is that it requires client side JavaScript.
|
||||||
|
</p>
|
||||||
|
</Layout>
|
||||||
|
)
|
||||||
|
}
|
||||||
12
apps/dev/pages/index.js
Normal file
12
apps/dev/pages/index.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import Layout from 'components/layout'
|
||||||
|
|
||||||
|
export default function Page () {
|
||||||
|
return (
|
||||||
|
<Layout>
|
||||||
|
<h1>NextAuth.js Example</h1>
|
||||||
|
<p>
|
||||||
|
This is an example site to demonstrate how to use <a href='https://next-auth.js.org'>NextAuth.js</a> for authentication.
|
||||||
|
</p>
|
||||||
|
</Layout>
|
||||||
|
)
|
||||||
|
}
|
||||||
30
apps/dev/pages/policy.js
Normal file
30
apps/dev/pages/policy.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import Layout from '../components/layout'
|
||||||
|
|
||||||
|
export default function Page () {
|
||||||
|
return (
|
||||||
|
<Layout>
|
||||||
|
<p>
|
||||||
|
This is an example site to demonstrate how to use <a href='https://next-auth.js.org'>NextAuth.js</a> for authentication.
|
||||||
|
</p>
|
||||||
|
<h2>Terms of Service</h2>
|
||||||
|
<p>
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
</p>
|
||||||
|
<h2>Privacy Policy</h2>
|
||||||
|
<p>
|
||||||
|
This site uses JSON Web Tokens and an in-memory database which resets every ~2 hours.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Data provided to this site is exclusively used to support signing in
|
||||||
|
and is not passed to any third party services, other than via SMTP or OAuth for the
|
||||||
|
purposes of authentication.
|
||||||
|
</p>
|
||||||
|
</Layout>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// This is an example of how to protect content using server rendering
|
// This is an example of how to protect content using server rendering
|
||||||
import { unstable_getServerSession } from "next-auth/next"
|
import { getServerSession } from "next-auth/next"
|
||||||
import { authOptions } from "./api/auth/[...nextauth]"
|
import { authOptions } from "./api/auth/[...nextauth]"
|
||||||
import Layout from "../components/layout"
|
import Layout from "../components/layout"
|
||||||
import AccessDenied from "../components/access-denied"
|
import AccessDenied from "../components/access-denied"
|
||||||
@@ -26,11 +26,7 @@ export default function Page({ content, session }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
export async function getServerSideProps(context) {
|
||||||
const session = await unstable_getServerSession(
|
const session = await getServerSession(context.req, context.res, authOptions)
|
||||||
context.req,
|
|
||||||
context.res,
|
|
||||||
authOptions
|
|
||||||
)
|
|
||||||
let content = null
|
let content = null
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { unstable_getServerSession } from "next-auth/next"
|
import { getServerSession } from "next-auth/next"
|
||||||
import Layout from "../components/layout"
|
import Layout from "../components/layout"
|
||||||
import { authOptions } from "./api/auth/[...nextauth]"
|
import { authOptions } from "./api/auth/[...nextauth]"
|
||||||
|
|
||||||
@@ -12,11 +12,11 @@ export default function Page() {
|
|||||||
<Layout>
|
<Layout>
|
||||||
<h1>Server Side Rendering</h1>
|
<h1>Server Side Rendering</h1>
|
||||||
<p>
|
<p>
|
||||||
This page uses the <strong>unstable_getServerSession()</strong> method
|
This page uses the <strong>getServerSession()</strong> method in{" "}
|
||||||
in <strong>getServerSideProps()</strong>.
|
<strong>getServerSideProps()</strong>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Using <strong>unstable_getServerSession()</strong> in{" "}
|
Using <strong>getServerSession()</strong> in{" "}
|
||||||
<strong>getServerSideProps()</strong> is currently the recommended
|
<strong>getServerSideProps()</strong> is currently the recommended
|
||||||
approach, although the API may still change, if you need to support
|
approach, although the API may still change, if you need to support
|
||||||
Server Side Rendering with authentication.
|
Server Side Rendering with authentication.
|
||||||
@@ -40,11 +40,7 @@ export default function Page() {
|
|||||||
export async function getServerSideProps(context) {
|
export async function getServerSideProps(context) {
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
session: await unstable_getServerSession(
|
session: await getServerSession(context.req, context.res, authOptions),
|
||||||
context.req,
|
|
||||||
context.res,
|
|
||||||
authOptions
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,6 @@ iframe {
|
|||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
height: 10rem;
|
height: 10rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 0.5rem;
|
border-radius: .5rem;
|
||||||
filter: invert(1);
|
filter: invert(1);
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@ export default function Page() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (session) {
|
if (session) {
|
||||||
|
console.log(session)
|
||||||
// User is logged in, let's fetch their data.
|
// User is logged in, let's fetch their data.
|
||||||
const { supabaseAccessToken } = session
|
const { supabaseAccessToken } = session
|
||||||
const supabase = createClient(
|
const supabase = createClient(
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// This is an example of how to protect content using server rendering
|
// This is an example of how to protect content using server rendering
|
||||||
// and fetching data from Supabase with RLS enabled.
|
// and fetching data from Supabase with RLS enabled.
|
||||||
import { unstable_getServerSession } from "next-auth/next"
|
import { getServerSession } from "next-auth/next"
|
||||||
import { authOptions } from "./api/auth/[...nextauth]"
|
import { authOptions } from "./api/auth/[...nextauth]"
|
||||||
import { createClient } from "@supabase/supabase-js"
|
import { createClient } from "@supabase/supabase-js"
|
||||||
import Layout from "../components/layout"
|
import Layout from "../components/layout"
|
||||||
@@ -27,11 +27,7 @@ export default function Page({ data, session }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getServerSideProps(context) {
|
export async function getServerSideProps(context) {
|
||||||
const session = await unstable_getServerSession(
|
const session = await getServerSession(context.req, context.res, authOptions)
|
||||||
context.req,
|
|
||||||
context.res,
|
|
||||||
authOptions
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!session)
|
if (!session)
|
||||||
return {
|
return {
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
GITHUB_ID=
|
|
||||||
GITHUB_SECRET=
|
|
||||||
# On UNIX systems you can use `openssl rand -hex 32` or
|
|
||||||
# https://generate-secret.vercel.app/32 to generate a secret.
|
|
||||||
AUTH_SECRET=
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
node_modules
|
|
||||||
/build
|
|
||||||
/.svelte-kit
|
|
||||||
/package
|
|
||||||
.env
|
|
||||||
.env.*
|
|
||||||
!.env.example
|
|
||||||
|
|
||||||
# Ignore files for PNPM, NPM and YARN
|
|
||||||
pnpm-lock.yaml
|
|
||||||
package-lock.json
|
|
||||||
yarn.lock
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
|
|
||||||
plugins: ['svelte3', '@typescript-eslint'],
|
|
||||||
ignorePatterns: ['*.cjs'],
|
|
||||||
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
|
|
||||||
settings: {
|
|
||||||
'svelte3/typescript': () => require('typescript')
|
|
||||||
},
|
|
||||||
parserOptions: {
|
|
||||||
sourceType: 'module',
|
|
||||||
ecmaVersion: 2020
|
|
||||||
},
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
es2017: true,
|
|
||||||
node: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
12
apps/dev/sveltekit/.gitignore
vendored
12
apps/dev/sveltekit/.gitignore
vendored
@@ -1,12 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
node_modules
|
|
||||||
/build
|
|
||||||
/.svelte-kit
|
|
||||||
/package
|
|
||||||
.env
|
|
||||||
.env.*
|
|
||||||
!.env.example
|
|
||||||
.vercel
|
|
||||||
.output
|
|
||||||
vite.config.js.timestamp-*
|
|
||||||
vite.config.ts.timestamp-*
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
.DS_Store
|
|
||||||
node_modules
|
|
||||||
/build
|
|
||||||
/.svelte-kit
|
|
||||||
/package
|
|
||||||
.env
|
|
||||||
.env.*
|
|
||||||
!.env.example
|
|
||||||
|
|
||||||
# Ignore files for PNPM, NPM and YARN
|
|
||||||
pnpm-lock.yaml
|
|
||||||
package-lock.json
|
|
||||||
yarn.lock
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"semi": false,
|
|
||||||
"plugins": ["prettier-plugin-svelte"],
|
|
||||||
"pluginSearchDirs": ["."],
|
|
||||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/example-sveltekit). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
|
|
||||||
|
|
||||||
<p align="center">
|
|
||||||
<br/>
|
|
||||||
<a href="https://authjs.dev" target="_blank"><img width="150px" src="https://authjs.dev/img/logo/logo-sm.png" /></a>
|
|
||||||
<h3 align="center">Auth.js Example App with <a href="https://kit.svelte.dev">SvelteKit</a></h3>
|
|
||||||
<p align="center">
|
|
||||||
Open Source. Full Stack. Own Your Data.
|
|
||||||
</p>
|
|
||||||
<p align="center" style="align: center;">
|
|
||||||
<a href="https://npm.im/@auth/sveltekit">
|
|
||||||
<img alt="npm" src="https://img.shields.io/npm/v/@auth/sveltekit?color=green&label=@auth/sveltekit&style=flat-square">
|
|
||||||
</a>
|
|
||||||
<a href="https://bundlephobia.com/result?p=sveltekit-auth-example">
|
|
||||||
<img src="https://img.shields.io/bundlephobia/minzip/@auth/sveltekit?label=size&style=flat-square" alt="Bundle Size"/>
|
|
||||||
</a>
|
|
||||||
<a href="https://www.npmtrends.com/@auth/sveltekit">
|
|
||||||
<img src="https://img.shields.io/npm/dm/@auth/sveltekit?label=%20downloads&style=flat-square" alt="Downloads" />
|
|
||||||
</a>
|
|
||||||
<a href="https://npm.im/next-auth">
|
|
||||||
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# Documentation
|
|
||||||
|
|
||||||
- [sveltekit.authjs.dev](https://sveltekit.authjs.dev)
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "sveltekit-auth-app",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "SvelteKit + Auth.js Developer app",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"dev": "vite dev",
|
|
||||||
"build": "vite build",
|
|
||||||
"preview": "vite preview",
|
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@sveltejs/adapter-auto": "next",
|
|
||||||
"@sveltejs/kit": "next",
|
|
||||||
"svelte": "3.55.0",
|
|
||||||
"svelte-check": "2.10.2",
|
|
||||||
"typescript": "4.9.4",
|
|
||||||
"vite": "4.0.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@auth/core": "workspace:*",
|
|
||||||
"@auth/sveltekit": "workspace:*"
|
|
||||||
},
|
|
||||||
"type": "module"
|
|
||||||
}
|
|
||||||
1
apps/dev/sveltekit/src/app.d.ts
vendored
1
apps/dev/sveltekit/src/app.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
/// <reference types="@auth/sveltekit" />
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
|
|
||||||
<meta name="viewport" content="width=device-width" />
|
|
||||||
%sveltekit.head%
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div>%sveltekit.body%</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { SvelteKitAuth } from "@auth/sveltekit"
|
|
||||||
import GitHub from "@auth/core/providers/github"
|
|
||||||
import { GITHUB_ID, GITHUB_SECRET } from "$env/static/private"
|
|
||||||
|
|
||||||
export const handle = SvelteKitAuth({
|
|
||||||
providers: [GitHub({ clientId: GITHUB_ID, clientSecret: GITHUB_SECRET })],
|
|
||||||
})
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
export let provider: any
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<form action={provider.signinUrl} method="POST">
|
|
||||||
{#if provider.callbackUrl}
|
|
||||||
<input type="hidden" name="callbackUrl" value={provider.callbackUrl} />
|
|
||||||
{/if}
|
|
||||||
<button type="submit" class="button">
|
|
||||||
<slot>Sign in with {provider.name}</slot>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import type { LayoutServerLoad } from "./$types"
|
|
||||||
|
|
||||||
export const load: LayoutServerLoad = async (event) => {
|
|
||||||
return {
|
|
||||||
session: await event.locals.getSession(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { page } from "$app/stores"
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<header>
|
|
||||||
<div class="signedInStatus">
|
|
||||||
<p class="nojs-show loaded">
|
|
||||||
{#if $page.data.session}
|
|
||||||
{#if $page.data.session.user?.image}
|
|
||||||
<span
|
|
||||||
style="background-image: url('{$page.data.session.user.image}')"
|
|
||||||
class="avatar"
|
|
||||||
/>
|
|
||||||
{/if}
|
|
||||||
<span class="signedInText">
|
|
||||||
<small>Signed in as</small><br />
|
|
||||||
<strong
|
|
||||||
>{$page.data.session.user?.email ??
|
|
||||||
$page.data.session.user?.name}</strong
|
|
||||||
>
|
|
||||||
</span>
|
|
||||||
<a href="/auth/signout" class="button">Sign out</a>
|
|
||||||
{:else}
|
|
||||||
<span class="notSignedInText">You are not signed in</span>
|
|
||||||
<a href="/auth/signin" class="buttonPrimary">Sign in</a>
|
|
||||||
{/if}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<nav>
|
|
||||||
<ul class="navItems">
|
|
||||||
<li class="navItem"><a href="/">Home</a></li>
|
|
||||||
<li class="navItem"><a href="/protected">Protected</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
:global(body) {
|
|
||||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
|
|
||||||
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
|
|
||||||
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
||||||
"Noto Color Emoji";
|
|
||||||
padding: 0 1rem 1rem 1rem;
|
|
||||||
max-width: 680px;
|
|
||||||
margin: 0 auto;
|
|
||||||
background: #fff;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
:global(li),
|
|
||||||
:global(p) {
|
|
||||||
line-height: 1.5rem;
|
|
||||||
}
|
|
||||||
:global(a) {
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
:global(hr) {
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
}
|
|
||||||
:global(iframe) {
|
|
||||||
background: #ccc;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
height: 10rem;
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
filter: invert(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.nojs-show {
|
|
||||||
opacity: 1;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
.signedInStatus {
|
|
||||||
display: block;
|
|
||||||
min-height: 4rem;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.loaded {
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
opacity: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 0 0 0.6rem 0.6rem;
|
|
||||||
padding: 0.6rem 1rem;
|
|
||||||
margin: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
|
||||||
transition: all 0.2s ease-in;
|
|
||||||
}
|
|
||||||
.signedInText,
|
|
||||||
.notSignedInText {
|
|
||||||
position: absolute;
|
|
||||||
padding-top: 0.8rem;
|
|
||||||
left: 1rem;
|
|
||||||
right: 6.5rem;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
display: inherit;
|
|
||||||
z-index: 1;
|
|
||||||
line-height: 1.3rem;
|
|
||||||
}
|
|
||||||
.signedInText {
|
|
||||||
padding-top: 0rem;
|
|
||||||
left: 4.6rem;
|
|
||||||
}
|
|
||||||
.avatar {
|
|
||||||
border-radius: 2rem;
|
|
||||||
float: left;
|
|
||||||
height: 2.8rem;
|
|
||||||
width: 2.8rem;
|
|
||||||
background-color: white;
|
|
||||||
background-size: cover;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
.button,
|
|
||||||
.buttonPrimary {
|
|
||||||
float: right;
|
|
||||||
margin-right: -0.4rem;
|
|
||||||
font-weight: 500;
|
|
||||||
border-radius: 0.3rem;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 1rem;
|
|
||||||
line-height: 1.4rem;
|
|
||||||
padding: 0.7rem 0.8rem;
|
|
||||||
position: relative;
|
|
||||||
z-index: 10;
|
|
||||||
background-color: transparent;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
.buttonPrimary {
|
|
||||||
background-color: #346df1;
|
|
||||||
border-color: #346df1;
|
|
||||||
color: #fff;
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 0.7rem 1.4rem;
|
|
||||||
}
|
|
||||||
.buttonPrimary:hover {
|
|
||||||
box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
.navItems {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
padding: 0;
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
||||||
.navItem {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 1rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<h1>SvelteKit Auth Example</h1>
|
|
||||||
<p>
|
|
||||||
This is an example site to demonstrate how to use <a
|
|
||||||
href="https://kit.svelte.dev/">SvelteKit</a
|
|
||||||
>
|
|
||||||
with <a href="https://sveltekit.authjs.dev">SvelteKit Auth</a> for authentication.
|
|
||||||
</p>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<script lang="ts">
|
|
||||||
import { page } from "$app/stores"
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if $page.data.session}
|
|
||||||
<h1>Protected page</h1>
|
|
||||||
<p>
|
|
||||||
This is a protected content. You can access this content because you are
|
|
||||||
signed in.
|
|
||||||
</p>
|
|
||||||
<p>Session expiry: {$page.data.session?.expires}</p>
|
|
||||||
{:else}
|
|
||||||
<h1>Access Denied</h1>
|
|
||||||
<p>
|
|
||||||
<a href="/auth/signin">
|
|
||||||
You must be signed in to view this page
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
{/if}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,15 +0,0 @@
|
|||||||
import adapter from '@sveltejs/adapter-auto';
|
|
||||||
import { vitePreprocess } from '@sveltejs/kit/vite';
|
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config} */
|
|
||||||
const config = {
|
|
||||||
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
|
||||||
// for more information about preprocessors
|
|
||||||
preprocess: vitePreprocess(),
|
|
||||||
|
|
||||||
kit: {
|
|
||||||
adapter: adapter()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./.svelte-kit/tsconfig.json",
|
|
||||||
"compilerOptions": {
|
|
||||||
"allowJs": true,
|
|
||||||
"checkJs": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"sourceMap": true,
|
|
||||||
"strict": true
|
|
||||||
}
|
|
||||||
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
|
|
||||||
//
|
|
||||||
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
|
||||||
// from the referenced tsconfig.json - TypeScript does not merge them in
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import { sveltekit } from "@sveltejs/kit/vite"
|
|
||||||
|
|
||||||
/** @type {import('vite').UserConfig} */
|
|
||||||
const config = {
|
|
||||||
plugins: [sveltekit()],
|
|
||||||
}
|
|
||||||
|
|
||||||
export default config
|
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"lib": ["dom", "dom.iterable", "esnext"],
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"esnext"
|
||||||
|
],
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": false,
|
"strict": false,
|
||||||
@@ -19,8 +23,17 @@
|
|||||||
{
|
{
|
||||||
"name": "next"
|
"name": "next"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"strictNullChecks": true
|
||||||
},
|
},
|
||||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
"include": [
|
||||||
"exclude": ["node_modules", "jest.config.js"]
|
"next-env.d.ts",
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
".next/types/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"jest.config.js"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
110
apps/example-gatsby/README.md
Normal file
110
apps/example-gatsby/README.md
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/example-gatsby). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<br/>
|
||||||
|
<a href="https://next-auth.js.org" target="_blank"><img width="150px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a>
|
||||||
|
<h3 align="center">NextAuth.js Example App</h3>
|
||||||
|
<p align="center">
|
||||||
|
Open Source. Full Stack. Own Your Data.
|
||||||
|
</p>
|
||||||
|
<p align="center" style="align: center;">
|
||||||
|
<a href="https://npm.im/next-auth">
|
||||||
|
<img alt="npm" src="https://img.shields.io/npm/v/next-auth?color=green&label=next-auth">
|
||||||
|
</a>
|
||||||
|
<a href="https://bundlephobia.com/result?p=next-auth-example">
|
||||||
|
<img src="https://img.shields.io/bundlephobia/minzip/next-auth?label=next-auth" alt="Bundle Size"/>
|
||||||
|
</a>
|
||||||
|
<a href="https://www.npmtrends.com/next-auth">
|
||||||
|
<img src="https://img.shields.io/npm/dm/next-auth?label=next-auth%20downloads" alt="Downloads" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
NextAuth.js is a complete open source authentication solution.
|
||||||
|
|
||||||
|
This is an example application that shows how `next-auth` is applied to a basic Gatsby app. We are showing how to configure the backend both as a [Vercel Function](https://vercel.com/docs/concepts/functions/introduction) for deployment to Vercel, and also for [Gatsby Functions](https://www.gatsbyjs.com/docs/reference/functions) for other platforms.
|
||||||
|
|
||||||
|
The deployed version can be found at [`next-auth-gatsby-example.vercel.app`](https://next-auth-gatsby-example.vercel.app)
|
||||||
|
|
||||||
|
### About NextAuth.js
|
||||||
|
|
||||||
|
NextAuth.js is an easy to implement, full-stack (client/server) open source authentication library originally designed for [Next.js](https://nextjs.org) and [Serverless](https://vercel.com), but this example shows how to use it in a Gatsby project. Our goal is to [support even more frameworks](https://github.com/nextauthjs/next-auth/issues/2294) in the future.
|
||||||
|
|
||||||
|
Go to [next-auth.js.org](https://next-auth.js.org) for more information and documentation.
|
||||||
|
|
||||||
|
> *NextAuth.js is not officially associated with Vercel or Next.js.*
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
### 1. Clone the repository and install dependencies
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/nextauthjs/next-auth-gatsby-example.git
|
||||||
|
cd next-auth-gatsby-example
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Configure your local environment
|
||||||
|
|
||||||
|
Copy the .env.local.example file in this directory to .env.local (which will be ignored by Git):
|
||||||
|
|
||||||
|
```
|
||||||
|
cp .env.local.example .env.local
|
||||||
|
```
|
||||||
|
|
||||||
|
Add details for one or more providers (e.g. Google, Twitter, GitHub, Email, etc).
|
||||||
|
|
||||||
|
#### Database
|
||||||
|
|
||||||
|
A database is needed to persist user accounts and to support email sign in. However, you can still use NextAuth.js for authentication without a database by using OAuth for authentication. If you do not specify a database, [JSON Web Tokens](https://jwt.io/introduction) will be enabled by default.
|
||||||
|
|
||||||
|
You **can** skip configuring a database and come back to it later if you want.
|
||||||
|
|
||||||
|
For more information about setting up a database, please check out the following links:
|
||||||
|
|
||||||
|
* Docs: [next-auth.js.org/adapters/overview](https://next-auth.js.org/adapters/overview)
|
||||||
|
|
||||||
|
### 3. Configure Authentication Providers
|
||||||
|
|
||||||
|
1. Review and update options in `nextauth.config.js` as needed.
|
||||||
|
|
||||||
|
2. When setting up OAuth, in the developer admin page for each of your OAuth services, you should configure the callback URL to use a callback path of `{server}/api/auth/callback/{provider}`.
|
||||||
|
|
||||||
|
e.g. For Google OAuth you would use: `http://localhost:3000/api/auth/callback/google`
|
||||||
|
|
||||||
|
A list of configured providers and their callback URLs is available from the endpoint `/api/auth/providers`. You can find more information at https://next-auth.js.org/configuration/providers/oauth
|
||||||
|
|
||||||
|
3. You can also choose to specify an SMTP server for passwordless sign in via email.
|
||||||
|
|
||||||
|
### 4. Start the application
|
||||||
|
|
||||||
|
To run your site locally, use:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
To run it in production mode, use:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
npm run start
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Preparing for Production
|
||||||
|
|
||||||
|
Follow the [Deployment documentation](https://next-auth.js.org/deployment)
|
||||||
|
|
||||||
|
## Acknowledgements
|
||||||
|
|
||||||
|
<a href="https://vercel.com?utm_source=nextauthjs&utm_campaign=oss">
|
||||||
|
<img width="170px" src="https://raw.githubusercontent.com/nextauthjs/next-auth/canary/www/static/img/powered-by-vercel.svg" alt="Powered By Vercel" />
|
||||||
|
</a>
|
||||||
|
<p align="left">Thanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire NextAuth.js Team</p>
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
ISC
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// Gatsby Functions are not yet supported on Vercel, so you'll need to use the root `api` folder.
|
// Gatsby Functions are not yet supported on Vercel, so you'll need to use the root `api` folder.
|
||||||
import NextAuth from "next-auth"
|
import NextAuth from "next-auth/next"
|
||||||
import { authConfig } from "../../nextauth.config"
|
import { authConfig } from "../../nextauth.config"
|
||||||
|
|
||||||
export default async function handler(req, res) {
|
export default async function handler(req, res) {
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^16.0.0",
|
"dotenv": "^16.0.0",
|
||||||
"gatsby": "next",
|
"gatsby": "next",
|
||||||
"next-auth": "workspace:*",
|
"next-auth": "latest",
|
||||||
"react": "^18",
|
"react": "^18",
|
||||||
"react-dom": "^18"
|
"react-dom": "^18"
|
||||||
},
|
},
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// If your deployment environment supports Gatsby Functions, you won't need the root `api` folder, only this.
|
// If your deployment environment supports Gatsby Functions, you won't need the root `api` folder, only this.
|
||||||
|
|
||||||
import NextAuth from "next-auth"
|
import NextAuth from "next-auth/next"
|
||||||
import { authConfig } from "../../nextauth.config"
|
import { authConfig } from "../../nextauth.config"
|
||||||
|
|
||||||
export default async function handler(req, res) {
|
export default async function handler(req, res) {
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user