mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Compare commits
189 Commits
@auth/core
...
@auth/soli
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d1c35e8aa | ||
|
|
a77f557cbf | ||
|
|
657492d921 | ||
|
|
d1d63bddba | ||
|
|
99ac4899b5 | ||
|
|
2130765a57 | ||
|
|
4079274aaf | ||
|
|
3d7985fd6d | ||
|
|
331e0ce51e | ||
|
|
8af666a4cc | ||
|
|
fed0a67917 | ||
|
|
0332d86942 | ||
|
|
8b38d32430 | ||
|
|
1e5f840a26 | ||
|
|
5981712681 | ||
|
|
dd2b85c6a5 | ||
|
|
3c0475acae | ||
|
|
416881c4c9 | ||
|
|
b91167091c | ||
|
|
497dacff41 | ||
|
|
2a1e1d1cd2 | ||
|
|
00f65b3476 | ||
|
|
470e55f8db | ||
|
|
d722962206 | ||
|
|
cee1bddbd5 | ||
|
|
e0ae913e5c | ||
|
|
1db27fcd07 | ||
|
|
95407df289 | ||
|
|
22adc2eb3c | ||
|
|
725f976b39 | ||
|
|
28ae5d4639 | ||
|
|
0f4d43e9ad | ||
|
|
28583b8ab0 | ||
|
|
1e7538a955 | ||
|
|
4258857e52 | ||
|
|
e9d8805609 | ||
|
|
fb43c5da05 | ||
|
|
326eadf0ed | ||
|
|
a5e0db4bb3 | ||
|
|
334e23343a | ||
|
|
be046a6cb2 | ||
|
|
bdee262abe | ||
|
|
3f89e668ec | ||
|
|
533320eb94 | ||
|
|
dfe6509472 | ||
|
|
1bde7cc8df | ||
|
|
cef05d5e2d | ||
|
|
c0dea283ba | ||
|
|
0204766e0f | ||
|
|
a336ba762c | ||
|
|
681d53c2f8 | ||
|
|
06e891c0ea | ||
|
|
b9a84350b5 | ||
|
|
44c38247da | ||
|
|
9b9af4d5e5 | ||
|
|
fd2179bdca | ||
|
|
7bb037bb9d | ||
|
|
52f70e9f4f | ||
|
|
505f69b519 | ||
|
|
b21709db40 | ||
|
|
aff7b37ef9 | ||
|
|
daa85be1ad | ||
|
|
c31718ca10 | ||
|
|
fbcfedf0e8 | ||
|
|
bd032335eb | ||
|
|
128e0f3a10 | ||
|
|
557fb9d741 | ||
|
|
b4d6ed5f5f | ||
|
|
035836da98 | ||
|
|
294039a497 | ||
|
|
b2450ef625 | ||
|
|
a81bb3e51e | ||
|
|
bb506f7eb9 | ||
|
|
87d9cc4244 | ||
|
|
d2e3b76031 | ||
|
|
c36834b3b0 | ||
|
|
8f7145801a | ||
|
|
fdce27b8ca | ||
|
|
4056dafa7a | ||
|
|
f0b61bd5fd | ||
|
|
866e42b343 | ||
|
|
6d4cde4b02 | ||
|
|
2377596bb6 | ||
|
|
3c7c25cefa | ||
|
|
c441f681af | ||
|
|
c05951f0f9 | ||
|
|
d142252499 | ||
|
|
700daec919 | ||
|
|
d8481f3825 | ||
|
|
3539a35601 | ||
|
|
3be7bb7a79 | ||
|
|
031cdd13b2 | ||
|
|
212b321f7e | ||
|
|
1ccb88b3f0 | ||
|
|
16d680b110 | ||
|
|
6e027811ef | ||
|
|
e5df406429 | ||
|
|
e4ddb533ff | ||
|
|
4e16b21a60 | ||
|
|
dd9f1b7421 | ||
|
|
4ebec5d385 | ||
|
|
c1f3cbda3c | ||
|
|
ba3ed049d1 | ||
|
|
9238294192 | ||
|
|
83c6bfe237 | ||
|
|
07109616c8 | ||
|
|
95c8f7930e | ||
|
|
8005f0cdb0 | ||
|
|
6e0ae59ed3 | ||
|
|
1b19aa39b8 | ||
|
|
69cda58707 | ||
|
|
b20a5f554a | ||
|
|
f8d77c4daf | ||
|
|
a3d23450a8 | ||
|
|
9abee0b2ee | ||
|
|
5cf580d10b | ||
|
|
00d495d9e3 | ||
|
|
5884574765 | ||
|
|
ae5360b028 | ||
|
|
7c963515b5 | ||
|
|
8cf4cc2ea9 | ||
|
|
9388a56efa | ||
|
|
3a75fb955a | ||
|
|
01bb91612a | ||
|
|
3b25935c83 | ||
|
|
394920dfd4 | ||
|
|
85dc5bede8 | ||
|
|
8f854c61d0 | ||
|
|
e8fbe58997 | ||
|
|
d2288ee4cc | ||
|
|
5a6f76bf2c | ||
|
|
15bed6260c | ||
|
|
1423733d61 | ||
|
|
77d8f47f51 | ||
|
|
3120d28299 | ||
|
|
e6a320bb0f | ||
|
|
7d4d436efe | ||
|
|
c6f5c4d1cf | ||
|
|
09a075cc7e | ||
|
|
f1475955ea | ||
|
|
e6f48775fa | ||
|
|
ba87e86d47 | ||
|
|
b0dd1fac93 | ||
|
|
054288316b | ||
|
|
5e02019a3c | ||
|
|
9da0e66193 | ||
|
|
287c8f0f91 | ||
|
|
87ed5077ad | ||
|
|
2cbf815445 | ||
|
|
d63166db3a | ||
|
|
f387793d71 | ||
|
|
b0ecf4e861 | ||
|
|
5a73c6efa3 | ||
|
|
4aec142525 | ||
|
|
45f423ed5d | ||
|
|
2e52a89c52 | ||
|
|
ecde35e9c4 | ||
|
|
5a51330d55 | ||
|
|
b2db3eabee | ||
|
|
3865e44c1e | ||
|
|
9f5acc5749 | ||
|
|
0bbc8246b8 | ||
|
|
511f66b0a8 | ||
|
|
ae57199258 | ||
|
|
aad425fced | ||
|
|
8ef1010bb1 | ||
|
|
950ca3169a | ||
|
|
edbf0fc011 | ||
|
|
46bac818fe | ||
|
|
9e64eb0cdd | ||
|
|
955e379330 | ||
|
|
7be4461253 | ||
|
|
c2e06dc445 | ||
|
|
4dd70a5f6f | ||
|
|
98dbf56494 | ||
|
|
6b4644f7e7 | ||
|
|
bcf909b69e | ||
|
|
4dcdd21242 | ||
|
|
137d993a13 | ||
|
|
8dda662cd6 | ||
|
|
8a438bab32 | ||
|
|
4aaad03e9c | ||
|
|
4fa0d1fa2a | ||
|
|
c081773667 | ||
|
|
1ab0a2aed4 | ||
|
|
cac9816d32 | ||
|
|
65defc709e | ||
|
|
1601626d31 | ||
|
|
8c4f439279 |
@@ -23,8 +23,8 @@ pnpm-lock.yaml
|
|||||||
|
|
||||||
.docusaurus
|
.docusaurus
|
||||||
build
|
build
|
||||||
docs/docs/reference/03-core
|
docs/docs/reference/core
|
||||||
docs/docs/reference/04-sveltekit
|
docs/docs/reference/sveltekit
|
||||||
static
|
static
|
||||||
|
|
||||||
# --------------- Packages ---------------
|
# --------------- Packages ---------------
|
||||||
|
|||||||
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"
|
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth,@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,12 +25,14 @@ 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"
|
||||||
@@ -57,6 +59,7 @@ body:
|
|||||||
- "Medium"
|
- "Medium"
|
||||||
- "Naver"
|
- "Naver"
|
||||||
- "Netlify"
|
- "Netlify"
|
||||||
|
- "Notion"
|
||||||
- "Okta"
|
- "Okta"
|
||||||
- "OneLogin"
|
- "OneLogin"
|
||||||
- "Osso"
|
- "Osso"
|
||||||
@@ -87,7 +90,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"
|
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth,@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" && npx envinfo --npmPackages "@next-auth/*"
|
npx envinfo --system --binaries --browsers --npmPackages "next,react,next-auth,@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:
|
||||||
|
|||||||
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](../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](https://github.com/nextauthjs/.github/blob/main/SECURITY.md) to disclose the issue to us confidentially.
|
||||||
|
|
||||||
## ☕️ Reasoning
|
## ☕️ Reasoning
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ Fixes: INSERT_ISSUE_LINK_HERE
|
|||||||
|
|
||||||
## 📌 Resources
|
## 📌 Resources
|
||||||
|
|
||||||
- [Security guidelines](../Security.md)
|
- [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md)
|
||||||
- [Contributing guidelines](../CONTRIBUTING.md)
|
- [Contributing guidelines](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md)
|
||||||
- [Code of conduct](../CODE_OF_CONDUCT.md)
|
- [Code of conduct](https://github.com/nextauthjs/.github/blob/main/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) 2018-2021, Iain Collins
|
Copyright (c) 2022-2023, Balázs Orbán
|
||||||
|
|
||||||
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,6 +540,7 @@ 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
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import * as github from "@actions/github"
|
|||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
import * as core from "@actions/core"
|
import * as core from "@actions/core"
|
||||||
import { readFileSync } from "node:fs"
|
import { readFileSync } from "node:fs"
|
||||||
|
import { join } from "node:path"
|
||||||
|
|
||||||
const addReproductionLabel = "incomplete"
|
const addReproductionLabel = "incomplete"
|
||||||
|
|
||||||
@@ -70,7 +71,12 @@ async function run() {
|
|||||||
}),
|
}),
|
||||||
client.issues.createComment({
|
client.issues.createComment({
|
||||||
...issueCommon,
|
...issueCommon,
|
||||||
body: readFileSync("repro.md", "utf8"),
|
body: readFileSync(
|
||||||
|
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,74 +1,26 @@
|
|||||||
# https://github.com/actions/labeler#create-githublabeleryml
|
# https://github.com/actions/labeler#create-githublabeleryml
|
||||||
|
adapters: ["packages/core/src/adapters.ts", "packages/adapter-*/**/*"]
|
||||||
test:
|
core: ["packages/core/src/**/*"]
|
||||||
- test/**/*
|
dgraph: ["packages/adapter-dgraph/**/*"]
|
||||||
- types/tests/**/*
|
documentation: ["packages/docs/docs/**/*"]
|
||||||
|
dynamodb: ["packages/adapter-dynamodb/**/*"]
|
||||||
providers:
|
examples: ["apps/examples/**/*"]
|
||||||
- packages/next-auth/src/providers/**/*
|
fauna: ["packages/adapter-fauna/**/*"]
|
||||||
- test/integration/**/*
|
firebase: ["packages/adapter-firebase/**/*"]
|
||||||
|
frameworks: ["packages/frameworks-*/**/*"]
|
||||||
adapters:
|
legacy: ["packages/next-auth/**/*"]
|
||||||
- packages/next-auth/src/adapters.ts
|
mikro-orm: ["packages/adapter-mikro-orm/**/*"]
|
||||||
- packages/adapter-*/**
|
mongodb: ["packages/adapter-mongodb/**/*"]
|
||||||
|
neo4j: ["packages/adapter-neo4j/**/*"]
|
||||||
dgraph:
|
playgrounds: ["apps/playgrounds/**/*"]
|
||||||
- packages/adapter-dgraph/**
|
pouchdb: ["packages/adapter-pouchdb/**/*"]
|
||||||
|
prisma: ["packages/adapter-prisma/**/*"]
|
||||||
dynamodb:
|
providers: ["packages/core/src/providers/**/*"]
|
||||||
- packages/adapter-dynamodb/**
|
sequelize: ["packages/adapter-sequelize/**/*"]
|
||||||
|
solidjs: ["packages/frameworks-solid-start/**/*"]
|
||||||
fauna:
|
supabase: ["packages/adapter-supabase/**/*"]
|
||||||
- packages/adapter-fauna/**
|
svelte: ["packages/frameworks-sveltekit/**/*"]
|
||||||
|
test: ["**test**/*"]
|
||||||
firebase:
|
typeorm-legacy: ["packages/adapter-typeorm-legacy/**/*"]
|
||||||
- packages/adapter-firebase/**
|
upstash-redis: ["packages/adapter-upstash-redis/**/*"]
|
||||||
|
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/**
|
|
||||||
|
|
||||||
core:
|
|
||||||
- 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/**/*
|
|
||||||
|
|||||||
11
.github/sync.yml
vendored
11
.github/sync.yml
vendored
@@ -1,14 +1,21 @@
|
|||||||
# Note that nextauthjs/next-auth-example syncs from the v4 branch
|
# Note that nextauthjs/next-auth-example syncs from the v4 branch
|
||||||
|
|
||||||
nextauthjs/sveltekit-auth-example:
|
nextauthjs/sveltekit-auth-example:
|
||||||
- source: apps/example-sveltekit
|
- source: apps/examples/sveltekit
|
||||||
|
dest: .
|
||||||
|
deleteOrphaned: true
|
||||||
|
- .github/FUNDING.yml
|
||||||
|
- LICENSE
|
||||||
|
|
||||||
|
nextauthjs/solid-start-auth-example:
|
||||||
|
- source: "apps/examples/solid-start"
|
||||||
dest: .
|
dest: .
|
||||||
deleteOrphaned: true
|
deleteOrphaned: true
|
||||||
- .github/FUNDING.yml
|
- .github/FUNDING.yml
|
||||||
- LICENSE
|
- LICENSE
|
||||||
|
|
||||||
nextauthjs/next-auth-gatsby-example:
|
nextauthjs/next-auth-gatsby-example:
|
||||||
- source: apps/playground-gatsby
|
- source: apps/playgrounds/gatsby
|
||||||
dest: .
|
dest: .
|
||||||
deleteOrphaned: true
|
deleteOrphaned: true
|
||||||
- .github/FUNDING.yml
|
- .github/FUNDING.yml
|
||||||
|
|||||||
19
.github/workflows/release.yml
vendored
19
.github/workflows/release.yml
vendored
@@ -29,9 +29,28 @@ jobs:
|
|||||||
run: pnpm install
|
run: pnpm install
|
||||||
- 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_TEAM: ${{ secrets.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:
|
||||||
|
|||||||
6
.github/workflows/sync-examples.yml
vendored
6
.github/workflows/sync-examples.yml
vendored
@@ -11,9 +11,9 @@ jobs:
|
|||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Run GitHub File Sync
|
- name: Run GitHub File Sync
|
||||||
# Can update to v1 when https://github.com/BetaHuhn/repo-file-sync-action/issues/168 is resolved
|
uses: balazsorban44/repo-file-sync-action@master
|
||||||
uses: BetaHuhn/repo-file-sync-action@v1.16.5
|
|
||||||
with:
|
with:
|
||||||
GH_PAT: ${{ secrets.SYNC_EXAMPLE_PAT }}
|
GH_PAT: ${{ secrets.GH_PAT }}
|
||||||
|
IS_FINE_GRAINED: true
|
||||||
SKIP_PR: true
|
SKIP_PR: true
|
||||||
ORIGINAL_MESSAGE: true
|
ORIGINAL_MESSAGE: true
|
||||||
|
|||||||
23
.gitignore
vendored
23
.gitignore
vendored
@@ -12,6 +12,7 @@ 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
|
||||||
|
|
||||||
|
|
||||||
@@ -34,13 +35,10 @@ packages/next-auth/utils
|
|||||||
packages/next-auth/core
|
packages/next-auth/core
|
||||||
packages/next-auth/jwt
|
packages/next-auth/jwt
|
||||||
packages/next-auth/react
|
packages/next-auth/react
|
||||||
packages/next-auth/adapters.d.ts
|
|
||||||
packages/next-auth/adapters.js
|
|
||||||
packages/next-auth/index.d.ts
|
|
||||||
packages/next-auth/index.js
|
|
||||||
packages/next-auth/next
|
packages/next-auth/next
|
||||||
packages/next-auth/middleware.d.ts
|
packages/*/*.js
|
||||||
packages/next-auth/middleware.js
|
packages/*/*.d.ts
|
||||||
|
packages/*/*.d.ts.map
|
||||||
|
|
||||||
# Development app
|
# Development app
|
||||||
apps/dev/src/css
|
apps/dev/src/css
|
||||||
@@ -81,13 +79,12 @@ docs/.docusaurus
|
|||||||
docs/providers.json
|
docs/providers.json
|
||||||
|
|
||||||
# Core
|
# Core
|
||||||
packages/core/*.js
|
packages/core/src/providers/oauth-types.ts
|
||||||
packages/core/*.d.ts
|
|
||||||
packages/core/*.d.ts.map
|
|
||||||
packages/core/lib
|
packages/core/lib
|
||||||
packages/core/providers
|
packages/core/providers
|
||||||
docs/docs/reference/03-core
|
packages/core/src/lib/pages/styles.ts
|
||||||
docs/docs/reference/04-sveltekit
|
docs/docs/reference/core
|
||||||
|
docs/docs/reference/sveltekit
|
||||||
|
|
||||||
|
|
||||||
# SvelteKit
|
# SvelteKit
|
||||||
@@ -97,3 +94,7 @@ 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
|
||||||
@@ -20,9 +20,10 @@ pnpm-lock.yaml
|
|||||||
|
|
||||||
.docusaurus
|
.docusaurus
|
||||||
build
|
build
|
||||||
docs/docs/reference/03-core
|
docs/docs/reference/core
|
||||||
docs/docs/reference/04-sveltekit
|
docs/docs/reference/sveltekit
|
||||||
static
|
static
|
||||||
|
docs/providers.json
|
||||||
|
|
||||||
# --------------- Packages ---------------
|
# --------------- Packages ---------------
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,16 @@ module.exports = {
|
|||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: [
|
files: [
|
||||||
"apps/dev/pages/api/auth/[...nextauth].ts",
|
"apps/dev/nextjs/pages/api/auth/[...nextauth].ts",
|
||||||
"docs/{sidebars,docusaurus.config}.js",
|
"docs/{sidebars,docusaurus.config}.js",
|
||||||
],
|
],
|
||||||
options: { printWidth: 150 },
|
options: { printWidth: 150 },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
files: ["**/*package.json"],
|
||||||
|
options: {
|
||||||
|
trailingComma: "none",
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
4
apps/dev/.vscode/settings.json
vendored
4
apps/dev/.vscode/settings.json
vendored
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"typescript.tsdk": "../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib",
|
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true
|
|
||||||
}
|
|
||||||
@@ -9,20 +9,39 @@ 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=
|
||||||
|
|
||||||
KEYCLOAK_ID=
|
# Beyond Identity Provider
|
||||||
KEYCLOAK_SECRET=
|
BEYOND_IDENTITY_CLIENT_ID=
|
||||||
KEYCLOAK_ISSUER=
|
BEYOND_IDENTITY_CLIENT_SECRET=
|
||||||
|
BEYOND_IDENTITY_ISSUER=
|
||||||
|
|
||||||
|
GITHUB_ID=
|
||||||
|
GITHUB_SECRET=
|
||||||
|
|
||||||
|
NOTION_ID=
|
||||||
|
NOTION_SECRET=
|
||||||
|
NOTION_REDIRECT_URI=
|
||||||
|
|
||||||
IDS4_ID=
|
IDS4_ID=
|
||||||
IDS4_SECRET=
|
IDS4_SECRET=
|
||||||
IDS4_ISSUER=
|
IDS4_ISSUER=
|
||||||
|
|
||||||
GITHUB_ID=
|
KEYCLOAK_ID=
|
||||||
GITHUB_SECRET=
|
KEYCLOAK_SECRET=
|
||||||
|
KEYCLOAK_ISSUER=
|
||||||
|
|
||||||
|
LINE_ID=
|
||||||
|
LINE_SECRET=
|
||||||
|
|
||||||
|
TRAKT_ID=
|
||||||
|
TRAKT_SECRET=
|
||||||
|
|
||||||
TWITCH_ID=
|
TWITCH_ID=
|
||||||
TWITCH_SECRET=
|
TWITCH_SECRET=
|
||||||
@@ -30,11 +49,8 @@ TWITCH_SECRET=
|
|||||||
TWITTER_ID=
|
TWITTER_ID=
|
||||||
TWITTER_SECRET=
|
TWITTER_SECRET=
|
||||||
|
|
||||||
LINE_ID=
|
WIKIMEDIA_ID=
|
||||||
LINE_SECRET=
|
WIKIMEDIA_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
|
||||||
@@ -47,12 +63,9 @@ 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
|
||||||
4
apps/dev/nextjs/.gitignore
vendored
Normal file
4
apps/dev/nextjs/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
node_modules/
|
||||||
|
/test-results/
|
||||||
|
/playwright-report/
|
||||||
|
/playwright/.cache/
|
||||||
4
apps/dev/nextjs/.vscode/settings.json
vendored
Normal file
4
apps/dev/nextjs/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"typescript.tsdk": "../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib",
|
||||||
|
"typescript.enablePromptUseWorkspaceTsdk": true
|
||||||
|
}
|
||||||
@@ -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/next-auth/blob/main/CONTRIBUTING.md#setting-up-local-environment)
|
](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md#setting-up-local-environment)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { signIn, signOut, useSession } from "next-auth/react"
|
import { 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,14 +24,7 @@ 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
|
<a href="/api/auth/signin" className={styles.buttonPrimary}>
|
||||||
href="/api/auth/signin"
|
|
||||||
className={styles.buttonPrimary}
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault()
|
|
||||||
signIn()
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Sign in
|
Sign in
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
@@ -47,14 +40,7 @@ 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
|
<a href="/api/auth/signout" className={styles.button}>
|
||||||
href="/api/auth/signout"
|
|
||||||
className={styles.button}
|
|
||||||
onClick={(e) => {
|
|
||||||
e.preventDefault()
|
|
||||||
signOut()
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Sign out
|
Sign out
|
||||||
</a>
|
</a>
|
||||||
</>
|
</>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "next-auth-app",
|
"name": "next-auth-app",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "NextAuth.js Developer app",
|
"description": "Next.js + Auth.js Developer app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf .next",
|
"clean": "rm -rf .next",
|
||||||
@@ -9,10 +9,12 @@
|
|||||||
"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:*",
|
||||||
@@ -20,17 +22,18 @@
|
|||||||
"@prisma/client": "^3",
|
"@prisma/client": "^3",
|
||||||
"@supabase/supabase-js": "^2.0.5",
|
"@supabase/supabase-js": "^2.0.5",
|
||||||
"faunadb": "^4",
|
"faunadb": "^4",
|
||||||
"next": "13.0.6",
|
"next": "13.1.1",
|
||||||
"next-auth": "workspace:*",
|
"next-auth": "workspace:*",
|
||||||
"@auth/core": "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.15",
|
||||||
"@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",
|
||||||
@@ -2,9 +2,11 @@ import { Auth, type AuthConfig } from "@auth/core"
|
|||||||
|
|
||||||
// Providers
|
// Providers
|
||||||
import Apple from "@auth/core/providers/apple"
|
import Apple from "@auth/core/providers/apple"
|
||||||
|
import Asgardeo from "@auth/core/providers/asgardeo"
|
||||||
import Auth0 from "@auth/core/providers/auth0"
|
import Auth0 from "@auth/core/providers/auth0"
|
||||||
import AzureAD from "@auth/core/providers/azure-ad"
|
import AzureAD from "@auth/core/providers/azure-ad"
|
||||||
import AzureB2C from "@auth/core/providers/azure-ad-b2c"
|
import AzureB2C from "@auth/core/providers/azure-ad-b2c"
|
||||||
|
import BeyondIdentity from "@auth/core/providers/beyondidentity"
|
||||||
import BoxyHQSAML from "@auth/core/providers/boxyhq-saml"
|
import BoxyHQSAML from "@auth/core/providers/boxyhq-saml"
|
||||||
// import Cognito from "@auth/core/providers/cognito"
|
// import Cognito from "@auth/core/providers/cognito"
|
||||||
import Credentials from "@auth/core/providers/credentials"
|
import Credentials from "@auth/core/providers/credentials"
|
||||||
@@ -23,6 +25,7 @@ import Instagram from "@auth/core/providers/instagram"
|
|||||||
import Line from "@auth/core/providers/line"
|
import Line from "@auth/core/providers/line"
|
||||||
import LinkedIn from "@auth/core/providers/linkedin"
|
import LinkedIn from "@auth/core/providers/linkedin"
|
||||||
import Mailchimp from "@auth/core/providers/mailchimp"
|
import Mailchimp from "@auth/core/providers/mailchimp"
|
||||||
|
import Notion from "@auth/core/providers/notion"
|
||||||
// import Okta from "@auth/core/providers/okta"
|
// import Okta from "@auth/core/providers/okta"
|
||||||
import Osu from "@auth/core/providers/osu"
|
import Osu from "@auth/core/providers/osu"
|
||||||
import Patreon from "@auth/core/providers/patreon"
|
import Patreon from "@auth/core/providers/patreon"
|
||||||
@@ -68,7 +71,7 @@ import WorkOS from "@auth/core/providers/workos"
|
|||||||
|
|
||||||
export const authConfig: AuthConfig = {
|
export const authConfig: AuthConfig = {
|
||||||
// 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",
|
||||||
@@ -82,6 +85,7 @@ 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,
|
||||||
@@ -89,6 +93,7 @@ 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 }),
|
||||||
@@ -105,6 +110,7 @@ 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 }),
|
||||||
107
apps/dev/nextjs/playwright.config.ts
Normal file
107
apps/dev/nextjs/playwright.config.ts
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
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;
|
||||||
39
apps/dev/nextjs/tests/signin.spec.ts
Normal file
39
apps/dev/nextjs/tests/signin.spec.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
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,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"name": "sveltekit-auth-app",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "SvelteKit + Auth.js Developer app",
|
||||||
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
@@ -15,8 +19,8 @@
|
|||||||
"vite": "4.0.1"
|
"vite": "4.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/core": "latest",
|
"@auth/core": "workspace:*",
|
||||||
"@auth/sveltekit": "latest"
|
"@auth/sveltekit": "workspace:*"
|
||||||
},
|
},
|
||||||
"type": "module"
|
"type": "module"
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import SvelteKitAuth from "@auth/sveltekit"
|
import { SvelteKitAuth } from "@auth/sveltekit"
|
||||||
import GitHub from "@auth/core/providers/github"
|
import GitHub from "@auth/core/providers/github"
|
||||||
import { GITHUB_ID, GITHUB_SECRET } from "$env/static/private"
|
import { GITHUB_ID, GITHUB_SECRET } from "$env/static/private"
|
||||||
|
|
||||||
@@ -2,9 +2,18 @@
|
|||||||
import { page } from "$app/stores"
|
import { page } from "$app/stores"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
{#if $page.data.session}
|
||||||
<h1>Protected page</h1>
|
<h1>Protected page</h1>
|
||||||
<p>
|
<p>
|
||||||
This is a protected content. You can access this content because you are
|
This is a protected content. You can access this content because you are
|
||||||
signed in.
|
signed in.
|
||||||
</p>
|
</p>
|
||||||
<p>Session expiry: {$page.data.session?.expires}</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}
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
5
apps/example-nextjs/next-env.d.ts
vendored
5
apps/example-nextjs/next-env.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="next" />
|
|
||||||
/// <reference types="next/image-types/global" />
|
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { redirect } from "@sveltejs/kit"
|
|
||||||
import type { PageLoad } from "./$types"
|
|
||||||
|
|
||||||
export const load: PageLoad = async ({ parent }) => {
|
|
||||||
const { session } = await parent()
|
|
||||||
if (!session?.user) {
|
|
||||||
throw redirect(302, "/")
|
|
||||||
}
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,14 @@
|
|||||||
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/example-nextjs). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
|
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/examples/nextjs). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<br/>
|
<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>
|
<a href="https://authjs.dev" target="_blank">
|
||||||
<h3 align="center">NextAuth.js Example App</h3>
|
<img height="64" src="https://authjs.dev/img/logo/logo-sm.png" />
|
||||||
|
</a>
|
||||||
|
<a href="https://nextjs.org" target="_blank">
|
||||||
|
<img height="64" src="https://nextjs.org/static/favicon/android-chrome-192x192.png" />
|
||||||
|
</a>
|
||||||
|
<h3 align="center"><b>NextAuth.js</b> - Example App</h3>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
Open Source. Full Stack. Own Your Data.
|
Open Source. Full Stack. Own Your Data.
|
||||||
</p>
|
</p>
|
||||||
@@ -25,20 +30,14 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
NextAuth.js is a complete open source authentication solution.
|
NextAuth.js is a complete open-source authentication solution.
|
||||||
|
|
||||||
This is an example application that shows how `next-auth` is applied to a basic Next.js app.
|
This is an example application that shows how `next-auth` is applied to a basic Next.js app.
|
||||||
|
|
||||||
The deployed version can be found at [`next-auth-example.vercel.app`](https://next-auth-example.vercel.app)
|
The deployed version can be found at [`next-auth-example.vercel.app`](https://next-auth-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). 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.
|
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
|
## Getting Started
|
||||||
|
|
||||||
### 1. Clone the repository and install dependencies
|
### 1. Clone the repository and install dependencies
|
||||||
@@ -98,15 +97,13 @@ npm run start
|
|||||||
|
|
||||||
### 5. Preparing for Production
|
### 5. Preparing for Production
|
||||||
|
|
||||||
Follow the [Deployment documentation](https://next-auth.js.org/deployment)
|
Follow the [Deployment documentation](https://authjs.dev/guides/basics/deployment) or deploy the example instantly using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-auth-example)
|
||||||
|
|
||||||
|
[](https://vercel.com/new/git/external?repository-url=https://github.com/nextauthjs/next-auth-example&project-name=next-auth-example&repository-name=next-auth-example)
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
<a href="https://vercel.com?utm_source=nextauthjs&utm_campaign=oss">
|
<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" />
|
<img width="170px" src="https://raw.githubusercontent.com/nextauthjs/next-auth/main/docs/static/img/powered-by-vercel.svg" alt="Powered By Vercel" />
|
||||||
</a>
|
</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>
|
<p align="left">Thanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire Auth.js Team</p>
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
ISC
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user