Compare commits

..

248 Commits

Author SHA1 Message Date
Balázs Orbán
b1774ca9bd fix firebase indent 2023-03-21 22:08:39 +01:00
Balázs Orbán
57356021fb tweak 2023-03-21 21:55:42 +01:00
Balázs Orbán
006ee59a2a docs: remove members titles 2023-03-21 21:11:01 +01:00
Balázs Orbán
93f3fcd1b7 chore: update TypeDoc 2023-03-21 19:38:50 +01:00
Lluis Agusti
1d9b9ba47c docs(adapters): source content + overview (#7023)
* docs(adapters): source content + overview

* Apply suggestions from code review

* add adapter packages as docs dependencies

* clean up docusaurus config

* clean up database overview

* fix some links

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-21 18:26:52 +00:00
Balázs Orbán
8f6108f230 docs: fix Mermaid rendering, lock gatsby playground versions 2023-03-21 18:54:10 +01:00
Balázs Orbán
15943d6696 docs: fix indent 2023-03-21 01:02:20 +01:00
Balázs Orbán
81589bf738 docs: remove/rename files/directories 2023-03-21 00:49:39 +01:00
Balázs Orbán
09402bf2fc fix: correct logo link 2023-03-20 22:45:14 +01:00
Balázs Orbán
e39a968a7b fix: correct logo link 2023-03-20 22:38:00 +01:00
Balázs Orbán
b03378be7f fix: correct links 2023-03-20 22:37:27 +01:00
Balázs Orbán
af415e9438 fix: correct link 2023-03-20 22:31:12 +01:00
Balázs Orbán
90eeeeab2f docs: unify adapters (#7013)
* remove unmaintained changelogs

* move logos to docs

* unify readmes

* fix logo urls
2023-03-20 21:28:23 +00:00
Balázs Orbán
f0b475fc72 docs: move adapters sidebar around 2023-03-20 21:59:19 +01:00
Balázs Orbán
f4f8c4a0b3 fix: links and references 2023-03-20 21:56:10 +01:00
Thang Vu
6f2cb460c9 feat: rewrite PouchDB Adapter (#6745)
BREAKING CHANGE:
Complete rewrite of the package. It is now published as ESM-only and written for `next-auth@4`. `next-auth@3` support is removed.

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-20 20:50:25 +00:00
Balázs Orbán
46f285f6f0 chore: fix test 2023-03-20 21:45:25 +01:00
Balázs Orbán
6bdb8af78d fix(test): export _id function for tests 2023-03-20 21:39:44 +01:00
James Billot
04e0637fd8 chore: fix typo in 'collectionsFactory' (#6985) 2023-03-20 17:47:38 +01:00
David Prothero
b5712448a1 fix(docs): correct module name (#6996) 2023-03-20 17:47:01 +01:00
Gabriel Manor
605d15c3cc docs: Add Permit.io Bronze Sponsor (#7008) 2023-03-20 17:42:11 +01:00
Anti Revoluzzer
d1479125cb fix: make nonce work correctly (#6998)
Co-authored-by: Anti Revoluzzer <anti@siimpl.io>
2023-03-20 12:07:11 +00:00
Abdulaziz Askaraliev
2e09bc0d19 docs: show close button (#7007) 2023-03-20 11:55:57 +00:00
Balázs Orbán
843fc6ff8f Merge branch 'main' of github.com:nextauthjs/next-auth 2023-03-20 12:51:22 +01:00
Balázs Orbán
6695ff8503 chore: add missing outputs to Turbo cache 2023-03-20 12:51:18 +01:00
Abdulaziz
80c1f375b8 docs: fix announcementBar fixed height cutting content inside itself (#6934) (#6975) 2023-03-16 11:53:01 +01:00
Abdulaziz
5a13288d47 docs: fix text overflow in li tags (#6973) 2023-03-16 11:52:13 +01:00
Balázs Orbán
26201e6271 chore: fix indentation 2023-03-16 02:23:46 +00:00
Balázs Orbán
d0d7b90ba1 chore: fix rm command 2023-03-16 02:59:16 +01:00
Balázs Orbán
874624dfbe fix(ts): fix type 2023-03-16 02:58:17 +01:00
Balázs Orbán
4b5cd08800 chore: add fauna adapter as docs dep 2023-03-16 02:53:30 +01:00
Lluis Agusti
1c104afef9 docs(fauna): move content to source (#6919)
* docs(fauna): move content to source

* chore: fix spelling

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-16 01:50:21 +00:00
Ólafur Waage
ff5b8ba8e2 fix(docs): Update documentation (#6956)
* Adding correct sveltekit client doc links.

* Updating urls for sveltekit index.
2023-03-16 01:02:27 +01:00
Jonas Strassel
42d5899efd fix(adapters): allow mongodb@5 as peer dependency (#6938) 2023-03-14 13:31:01 +01:00
Jonas Strassel
b278975c3f chore(ci): disable node cache to speed up ci (#6939) 2023-03-14 13:29:18 +01:00
Ábris Simon
997e595b5b fix(docs:) simplify authorization example (#6910)
* simplify authorization example for sveltekit

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-10 16:41:00 +00:00
Balázs Orbán
527c25b128 chore: add clean script to dynamodb adapter 2023-03-10 10:56:09 +01:00
Balázs Orbán
0e2bbda537 docs: remove duplicate API reference 2023-03-10 10:51:17 +01:00
Balázs Orbán
7f3b35593f chore: tweak turbo config 2023-03-10 10:37:47 +01:00
Lluis Agusti
bce6b00c43 docs(dynamodb): move content to source (#6903)
* chore: wip

* chore: done

* chore: fix

* update lock file

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-09 11:33:53 +00:00
Balázs Orbán
1bbd5d51d1 chore: add adapters as docs dependencies 2023-03-09 12:24:00 +01:00
Lluis Agusti
b24b02fe71 docs(mongodb): move content to source (#6901)
* docs(mongodb): move content to source

* chore: document options

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-09 11:22:54 +00:00
Lluis Agusti
2c5c4d18c4 docs(typeorm): move content to source (#6896)
* docs(typeorm): move content to source

* chore: fix fn

* chore: document options

* Update index.ts

* chore: update logo

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-09 11:20:04 +00:00
Balázs Orbán
e3f9b398f0 chore: add adapters to docs as dependencies 2023-03-09 12:00:19 +01:00
Balázs Orbán
ab13930020 chore: tweak turbo cache 2023-03-09 11:48:45 +01:00
Nico Domino
f6bb16b264 chore: update README sponsors - fusionauth level (#6892) 2023-03-08 16:54:54 +00:00
Nico Domino
a220245d03 chore(repo): add FusionAuth to README supporters (#6883)
* chore(repo): add FusionAuthu to README supporters

* chore(repo): put sponsors on two lines of 5
2023-03-07 08:53:25 +07:00
Lluis Agusti
7462e797de fix(adapter): improve Adapter docs, add runtime assertions (#6877)
* docs(adapters): move dgraph adapters docs to source code

* refactor: review suggestions (1)

* docs(prisma): move content to source code

* chore: sort

* fix: dgraph logo and content
2023-03-05 17:19:04 +01:00
Balázs Orbán
36286b1fae fix(adapter): improve Adapter docs, add runtime assertions (#6612)
* fix(ts): improve Adapter documentation

* chore: simplify code

* assert missing adapter methods

* add federated logout guide link

* oidc -> oauth
2023-03-05 15:39:23 +00:00
Nico Domino
2e8e90a9be chore(docs): new guide for sending email via http api (#6555)
* chore(docs): new guide for sending email via http api

* chore(docs): prettier code blocks

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* fix: relative links and remove prisma specific mention

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Update docs/docs/guides/04-providers/03-email-http-api.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>

* chore: reword to be more inclusive

* feat: use custom provider

* Apply suggestions from code review

* code review changes

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-05 15:32:08 +00:00
Balázs Orbán
d06a552bf6 chore: format 2023-03-05 16:07:51 +01:00
Lluis Agusti
5cb8dd5f37 fix(docs): add docs to source code (#6870)
* docs(adapters): move dgraph adapters docs to source code

* refactor: review suggestions (1)
2023-03-05 15:57:02 +01:00
GitHub Actions
7c1a3b547e chore(release): bump package version(s) [skip ci] 2023-03-05 05:08:02 +00:00
Josh Schlesser
2534ae8801 feat(sveltekit): allow dynamic authOptions (#6744)
* added optional dynamic sveltekit options

* changed dynamicOptions function to async

* converted dynamicOptions to a named type

* updated inline docs to show async capabilities

* Update packages/frameworks-sveltekit/src/lib/index.ts

Co-authored-by: Thang Vu <hi@thvu.dev>

* Update packages/frameworks-sveltekit/src/lib/index.ts

Co-authored-by: Thang Vu <hi@thvu.dev>

* Update packages/frameworks-sveltekit/src/lib/index.ts

Co-authored-by: Thang Vu <hi@thvu.dev>

* Update packages/frameworks-sveltekit/src/lib/index.ts

Co-authored-by: Thang Vu <hi@thvu.dev>

* Update packages/frameworks-sveltekit/src/lib/index.ts

Co-authored-by: Thang Vu <hi@thvu.dev>

* refined to a simpler function signature

* removed redundant return statement

* Apply suggestions from code review

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-03-04 12:21:14 +07:00
Thomas Guillet
14a120277b docs(sveltekit): Write the explicit file to update in sveltekit (#6846) 2023-03-01 09:31:30 +07:00
Josh Schlesser
c49f484743 fix(providers): add default user agent for GitHub (#6742)
See: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required
2023-02-28 12:56:28 +01:00
Richard Tuin
676b39d5b1 docs: Improve naming on role based access (#6820) 2023-02-28 12:54:26 +01:00
Balázs Orbán
e27dbcab2f chore: tweak "incomplete" comment 2023-02-28 12:48:51 +01:00
Thang Vu
63805c7d75 fix: JWT maxAge default to Session maxAge value (#6829)
* fix: JWT maxAge default to Session maxAge value

Co-Authored-By: Ethan Wilkes <33569440+roberte777@users.noreply.github.com>

* Move to core

Co-Authored-By: Ethan Wilkes <33569440+roberte777@users.noreply.github.com>

---------

Co-authored-by: Ethan Wilkes <33569440+roberte777@users.noreply.github.com>
2023-02-27 08:30:14 +07:00
GitHub Actions
5d1c35e8aa chore(release): bump package version(s) [skip ci] 2023-02-24 14:20:38 +00:00
James Birtles
a77f557cbf fix: claims being serialized multiple times over (#6781) 2023-02-23 15:02:13 +01:00
Thang Vu
657492d921 docs: Improve Getting Started (#6551)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Lluis Agusti <hi@llu.lu>
2023-02-23 14:55:14 +01:00
Will
d1d63bddba chore: Add 🥈 Silver Financial Sponsors (#6757)
Add Silver Sponsors to the README
2023-02-23 11:32:48 +07:00
Will
99ac4899b5 feat(providers): add Beyond Identity Provider (#6013)
* Add Beyond Identity Provider

* Add Beyond Identity OIDC Provider

* Add Beyond Identity OIDC Provider

* Add "pkce" support

* Mirror Auth0 instead of Okta

* Code Review feedback
2023-02-23 11:04:21 +07:00
Balázs Orbán
2130765a57 docs: remove duplicate from sidebar 2023-02-19 17:13:06 +01:00
Balázs Orbán
4079274aaf fix(providers): document Azure AD B2C 2023-02-19 17:12:54 +01:00
OrJDev
3d7985fd6d fix: multiple set-cookie headers (#6749)
* fix: multiple set-cookie headers

* fx
2023-02-17 19:08:41 +01:00
Thang Vu
331e0ce51e fix(adapters): comply to Node.js native ESM resolver (#6753)
* fix(adapters): comply to Node.js native ESM resolver for Firebase adapter

* fix import

* use single file

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-17 14:39:06 +00:00
Balázs Orbán
8af666a4cc fix: correct package name 2023-02-17 13:05:40 +01:00
Jakob Norlin
fed0a67917 fix: compatibility with edge runtimes (#6739)
* Bump @panva/hkdf to v1.0.3

Fixes #6736

* Update to v1.0.4

v.1.0.3 failed to publish it seems

* update lockfile

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-17 11:24:17 +00:00
Erik André Jakobsen
0332d86942 docs: fix dead external prisma link (#6721)
A very minor change, but thought I would fix it when I saw it :)
2023-02-17 11:15:49 +00:00
Balázs Orbán
8b38d32430 docs: update refresh token guide
closes #6696
2023-02-13 13:44:40 +00:00
Balázs Orbán
1e5f840a26 chore: fix import
fixes #6699
2023-02-13 14:31:22 +01:00
Lioness100
5981712681 fix: address typos (#6701)
* docs: fix typos

* revert: typo fixes in packages/next-auth
2023-02-13 12:51:54 +00:00
Skyf0l
dd2b85c6a5 chore: add missing angle bracket in package.json contributors (#6698) 2023-02-12 21:01:56 +07:00
Balázs Orbán
3c0475acae fix(ts): fix typo in JSDoc 2023-02-10 02:18:08 +01:00
Balázs Orbán
416881c4c9 Merge branch 'main' of github.com:nextauthjs/next-auth 2023-02-10 02:10:30 +01:00
Balázs Orbán
b91167091c fix(ts): use default exports for all providers uniformly
closes #6615
2023-02-10 02:10:27 +01:00
JT A
497dacff41 docs: fix code example nesting (#6666)
While doing the Getting Started guide, we noticed that the configuration was incorrect.

cc: @obrowner-rdc
2023-02-10 01:51:29 +01:00
JT A
2a1e1d1cd2 docs: use correct env variable names (#6668)
The documentation had the incorrect environment variable names used in the configuration for `Email` provider.
2023-02-10 01:50:00 +01:00
Balázs Orbán
00f65b3476 docs: fix indent 2023-02-10 01:47:55 +01:00
Pavlos Vinieratos
470e55f8db docs: fix typo (#6674)
Update 02-oauth-tutorial.mdx
2023-02-10 01:42:43 +01:00
Balázs Orbán
d722962206 fix(ts): correct credentials types in authorize callback (#6648)
* fix(ts): correct `credentials` types in `authorize` callback

* Apply suggestions from code review

Co-authored-by: Thang Vu <hi@thvu.dev>

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-02-09 13:05:56 +01:00
AlandSleman
cee1bddbd5 docs: Fix Getting started page (#6636)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-07 15:08:29 +01:00
Rémi Robichet
e0ae913e5c docs: fix type import (#6638) 2023-02-07 15:06:48 +01:00
Thang Vu
1db27fcd07 chore(monorepo): cache docs/build 2023-02-06 10:03:32 +07:00
Thang Vu
95407df289 chore(monorepo): cache typedoc generated files 2023-02-06 09:54:36 +07:00
Balázs Orbán
22adc2eb3c docs: fix redirects 2023-02-06 00:04:44 +01:00
Balázs Orbán
725f976b39 docs: fix redirects 2023-02-06 00:03:28 +01:00
MatyiFKBT
28ae5d4639 fix(providers): update Foursquare API version (#6620) 2023-02-05 15:30:57 +01:00
GitHub Actions
0f4d43e9ad chore(release): bump package version(s) [skip ci] 2023-02-05 13:52:31 +00:00
Thang Vu
28583b8ab0 feat: drop crypto dependency, convert to ESM (#6603)
Co-authored-by: Balázs Orbán <info@balazsorban.com>

BREAKING CHANGE:
- This package now only ships ESM, as all maintained Node.js versions have native support
- Dropped the `crypto` Node.js import in favor of `uuid`. When `globalThis.crypto` is the default in the future, we can remove `uuid` again
2023-02-05 14:44:33 +01:00
Balázs Orbán
1e7538a955 fix: publish .d.ts.map, add experimental warning 2023-02-05 14:42:07 +01:00
Wyatt Ades
4258857e52 feat(adapters): move to firebase-admin in Firebase Adapter (#6225)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
fixes https://github.com/nextauthjs/next-auth/issues/5049
closes https://github.com/nextauthjs/next-auth/pull/6230
closes https://github.com/nextauthjs/next-auth/pull/5449
closes https://github.com/nextauthjs/next-auth/pull/5055
fixes https://github.com/nextauthjs/next-auth/issues/4927

BREAKING CHANGE:
The adapter now expects `firebase-admin` instead of the `firebase` package and also supports either passing a config object or a firestore instance.
2023-02-05 14:41:20 +01:00
Balázs Orbán
e9d8805609 docs: api reference restructure (#6608) 2023-02-04 15:39:12 +01:00
Mayvis
fb43c5da05 docs: enhance prisma mongodb doc to prevent warning (#6598)
Fixes https://github.com/nextauthjs/next-auth/issues/6597
2023-02-02 13:28:17 +01:00
Corey Jepperson
326eadf0ed fix: don't add /error to url pathname when email verification is successful (#6492)
fix handleAuthorized making bad pth when authorize

Co-authored-by: Corey Jepperson <corey@entropy.cc>
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-01-31 17:37:38 +07:00
Thang Vu
a5e0db4bb3 feat(providers): add Notion provider (#6567)
* add notion provider along with logo and styles
"

* adjust notion documentation

* update issue template with Notion provider

* update docs and provider with code from TomYeoman

* feat: move Notion provider to core

* get it working

---------

Co-authored-by: Harrison Broadbent <harrisonbroadbent@gmail.com>
Co-authored-by: Harrison Broadbent <harrisonbroadbent@Harrisons-MacBook-Air.local>
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-01-31 17:10:47 +07:00
Balázs Orbán
334e23343a chore: fix typo 2023-01-31 01:19:16 +01:00
OrJDev
be046a6cb2 chore: suggest using the correct command to seek for packages (#6570)
* fix: suggest using the correct command to seek for packages

* seek for adapter packages aswell

* cleanup: seek for auth org packages
2023-01-30 20:39:37 +01:00
Frank Dumont
bdee262abe fix: typo in log message (#6569) 2023-01-30 20:37:53 +01:00
Balázs Orbán
3f89e668ec fix(ts): mark options provider config option internal (#6564)
* chore(dev): use workspace modules in Svelte app

* fix(ts): mark `options` provider config option internal
2023-01-30 12:34:54 +00:00
Balázs Orbán
533320eb94 chore: generate oauth-types on build 2023-01-29 14:33:41 +01:00
James
dfe6509472 fix: comment Discord profile, fix @auth/sveltekit build on Windows (#6550)
* fix: discord types were inaccurate

* fix: build on windows computers

* Apply review suggestions

* Update discord.ts

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-01-29 12:05:14 +00:00
Oskar
1bde7cc8df fix(core): correct docs link (#6446) 2023-01-26 12:16:47 +00:00
Balázs Orbán
cef05d5e2d Merge branch 'main' of github.com:nextauthjs/next-auth 2023-01-26 13:11:14 +01:00
Balázs Orbán
c0dea283ba fix(core): avoid circular dependency
Fixes #6508
2023-01-26 13:11:04 +01:00
Balázs Orbán
0204766e0f fix(core): don't lock nodemailer version as peer dependency 2023-01-25 14:29:16 +00:00
Jérémie Sellam
a336ba762c fix(adapters): allow already initialized firebase app 🐛 (#6230)
* 🐛 Fix already initialized firebase app

* remove comment

Co-authored-by: Jérémie Sellam <jeremie@southpigalle.io>
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-01-25 19:57:52 +07:00
Balázs Orbán
681d53c2f8 chore(core): cleanup 2023-01-24 14:01:40 +01:00
Thang Vu
06e891c0ea chore: cache output for @auth/sveltekit 2023-01-24 15:22:42 +07:00
GitHub Actions
b9a84350b5 chore(release): bump package version(s) [skip ci] 2023-01-24 02:02:00 +00:00
Balázs Orbán
44c38247da chore: trigger CI 2023-01-24 02:58:49 +01:00
Balázs Orbán
9b9af4d5e5 chore: bump versions [skip ci] 2023-01-24 02:56:31 +01:00
Balázs Orbán
fd2179bdca Merge branch 'main' of github.com:nextauthjs/next-auth 2023-01-24 02:42:16 +01:00
Balázs Orbán
7bb037bb9d chore: temp. disable E2E tests 2023-01-24 02:42:13 +01:00
Robin Panta
52f70e9f4f docs: update "guide deep-dive" link (#6473)
Fixes https://github.com/nextauthjs/next-auth/issues/6466
2023-01-24 02:34:45 +01:00
Balázs Orbán
505f69b519 chore: fix pipeline 2023-01-24 02:29:10 +01:00
Balázs Orbán
b21709db40 chore: update lock file 2023-01-24 02:26:49 +01:00
Balázs Orbán
aff7b37ef9 Merge branch 'main' of github.com:nextauthjs/next-auth 2023-01-24 02:26:00 +01:00
Balázs Orbán
daa85be1ad Revert "chore(next-auth): remove engines restriction (#6428)"
This reverts commit 035836da98.
2023-01-24 02:25:45 +01:00
Balázs Orbán
c31718ca10 fix(core): sign cookies with built-in jwt methods (#6488) 2023-01-24 02:21:56 +01:00
Balázs Orbán
fbcfedf0e8 fix(providers): default image to null for Azure AD 2023-01-24 02:21:27 +01:00
Balázs Orbán
bd032335eb docs: rename file 2023-01-23 13:41:21 +01:00
Balázs Orbán
128e0f3a10 docs: update RBAC guide 2023-01-23 13:40:45 +01:00
Thang Vu
557fb9d741 chore: ignore e2e actions in forks 2023-01-23 12:28:48 +07:00
Thang Vu
b4d6ed5f5f feat(providers): add Asgardeo provider (#6452)
* implement asgardeo auth provider

* Import asgardeo provider in to providers

* Improve provider configuration

* simplify and improve the asgardeo provider

* Delete package-lock.json

* converted server origin to organization

* revamp provider configs

* update profile interface

* Remove asgardeo issuer parameter and add docs

* fixed docs

* Update asgardeo.md

* Update docs and provider branding

* Remove mistakenly added code from dev app

* move to core

* Delete asgardeo.md

Co-authored-by: Yathindra <yathindrarawya123@gmail.com>
Co-authored-by: Yathindra Kodithuwakku <32919513+yathindrakodithuwakku@users.noreply.github.com>
Co-authored-by: Yathindra Kodithuwakku <32919513+yathindrak@users.noreply.github.com>
2023-01-22 01:30:42 +07:00
Richard Shin
035836da98 chore(next-auth): remove engines restriction (#6428)
* fix: add node 19 as compatible engine

* remove engines restriction

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-01-21 16:29:45 +07:00
Atila Fassina
294039a497 docs(xata-adapter): adjust json schema (#6440) 2023-01-20 11:17:00 +00:00
Balázs Orbán
b2450ef625 fix(providers): conform Twitch provider to spec with escape hatch (#6365)
* fix(core): add explicit non-conform escape hatch

* fix(core): default to first supported auth method

* fix(core): stringify `claims` authorization url param

* fix(providers): conform Twitch provider to spec with escape hatch

* configure `client_secret_post` explicitly in provider
2023-01-19 10:28:14 +00:00
Balázs Orbán
a81bb3e51e feat(core): option to opt out of CSRF checks (#6379)
* feat(core): add way to opt-out of CSRF checks

* fix logic

* add warning if CSRF endpoint used when skipped
2023-01-19 10:27:18 +00:00
Robin Panta
bb506f7eb9 docs: Fix token expiry comparision in database strategy (#6430)
* Fix token expiry comparision in database strategy

fixes the condition used for example
in database strategy

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-01-18 15:26:23 +00:00
Thang Vu
87d9cc4244 feat: e2e tests (#6380)
* feat: e2e test init

* run e2e test on CI

* Add credentials to ci

* Update pnpm-lock.yaml

* move test to dev

* add dotenv

* remove in examples

* add e2e command

* revert

* add output cache for turbo e2e

* correct path for upload artifact

* Update release.yml
2023-01-18 19:43:50 +07:00
uatemycookie22
d2e3b76031 docs: Update 02-oauth-tutorial.mdx (#6408)
Fix typos in 02-oath-tutorial.mdx
2023-01-17 00:24:48 +01:00
Jan-David-Black
c36834b3b0 docs: Updating to _app.tsx (#6398)
file should be called `_app.tsx` instead of `_app.ts`
2023-01-17 00:24:04 +01:00
khuezy
8f7145801a feat(adapters): expose DynamoDB adapter options (#6370)
* feat: add dynmodb adaption options

* fix typo

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-01-12 09:59:18 +00:00
Balázs Orbán
fdce27b8ca fix(providers): remove Twitter OAuth 2.0 workaround 2023-01-11 13:00:15 +01:00
Rhys
4056dafa7a docs: Minor grammar in email docs (#6358)
Grammar in email docs
2023-01-11 07:56:08 +01:00
Mahammedi Abdelghani
f0b61bd5fd docs: fix broken links (#6359)
- fix some Provider options links ".js" --> ".ts"
2023-01-11 07:55:27 +01:00
Thang Vu
866e42b343 chore: revert to latest dependencies for examples 2023-01-10 21:05:06 +07:00
${Mr.DJA}
6d4cde4b02 feat(core): allow clearing cookies from jwt() (#6337)
* feat(core): allow clearing cookies from `jwt()`

* revert: allow clearing cookies from `jwt()`

* feat(core): re-apply changes against `@auth/core`

* revert: `decodeJWT` option

* doc: `jwt()` callback

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-01-10 12:11:52 +00:00
Ben
2377596bb6 chore(examples): avoid prefetch of non-existing routes in SvelteKit (#6351)
Avoid prefetch of non-existing routes

This avoids prefetch of the /auth/signin and /auth/signout virtual links as they do not exist in sveltkit routes
2023-01-10 11:56:25 +00:00
Balázs Orbán
3c7c25cefa docs: improve some provider docs 2023-01-10 12:51:39 +01:00
Thang Vu
c441f681af chore: don't use latest for examples dependencies 2023-01-10 13:37:51 +07:00
Balázs Orbán
c05951f0f9 docs: add Auth0 and GitHub header 2023-01-09 16:53:30 +01:00
Balázs Orbán
d142252499 chore: update lock file, prettier config 2023-01-09 13:29:28 +01:00
Nathan Meadows
700daec919 fix(docs): page.server.ts -> layout.server.ts (#6326)
Fix documentation mistake - page.server.ts -> layout.server.ts
2023-01-09 08:43:34 +00:00
OrJDev
d8481f3825 chore(core): use arrow function for generateSessionToken (#6200)
* fix

* prettify

* Update init.ts

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-01-09 08:38:33 +00:00
Balázs Orbán
3539a35601 chore: trigger sync 2023-01-07 09:52:33 +01:00
Balázs Orbán
3be7bb7a79 chore: try fork 2023-01-07 09:50:12 +01:00
Balázs Orbán
031cdd13b2 chore: try adding deleteOrphaned back 2023-01-07 09:37:00 +01:00
Balázs Orbán
212b321f7e chore: remove delete orphaned 2023-01-07 09:29:23 +01:00
Balázs Orbán
1ccb88b3f0 chore: try excluding git 2023-01-07 09:27:35 +01:00
Balázs Orbán
16d680b110 chore: revert 2023-01-07 09:04:13 +01:00
Balázs Orbán
6e027811ef chore: set git config globally 2023-01-07 09:01:33 +01:00
Balázs Orbán
e5df406429 chore: try adding email+username 2023-01-07 08:56:25 +01:00
Balázs Orbán
e4ddb533ff chore: hint that we want to use fine grained GH_PAT 2023-01-07 08:48:15 +01:00
Balázs Orbán
4e16b21a60 chore: update sync GH Action 2023-01-07 08:41:43 +01:00
Balázs Orbán
dd9f1b7421 chore: move provider logos under /img 2023-01-07 08:12:24 +01:00
Balázs Orbán
4ebec5d385 docs: fix marquee 2023-01-07 08:04:56 +01:00
Balázs Orbán
c1f3cbda3c chore: move icons to website 2023-01-07 08:02:27 +01:00
Sacramentix
ba3ed049d1 fix: typo on example resposne -> response (#6311) 2023-01-07 07:49:56 +01:00
Balázs Orbán
9238294192 feat(core): Redesigned all default pages (#5825)
* feat(pages): Redesigned all default pages according to sketches discussed.

* chore(signin): Remove console.log

* fix(css): Makes cards scale down to 320px and have a fixed width on larger screens

* fix(styling): Adds margins on bottom and top of card.

* chore(docs): Change the documentation according to changes. Uploaded new images that reflect the new pages.

* fix(next-auth/core): Fixes correct styling of provider button across browsers.

* chore(docs): Add doc string to beta docs aswell

* feat: move changes to core

* revert change in next-auth

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Thang Vu <hi@thvu.dev>
revert signin
2023-01-07 07:49:56 +01:00
Balázs Orbán
83c6bfe237 fix(core): improve stack traces (#6259) 2023-01-07 07:47:30 +01:00
Tyler Miller
07109616c8 docs(sveltekit): Typo fix (#6309)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-01-07 07:47:30 +01:00
Ikko Eltociear Ashimine
95c8f7930e chore: Fix typo in solid-start/README.MD (#6305) 2023-01-07 07:47:30 +01:00
Thang Vu
8005f0cdb0 chore: update watch command for next-auth dev 2023-01-07 07:47:30 +01:00
Finn
6e0ae59ed3 docs(providers): added JS doc's to the mattermost provider (#6299)
* aded js doc

* engerish
2023-01-07 07:47:30 +01:00
Kostas Botsas
1b19aa39b8 fix(adapters): remove formatVersion from Xata schema (#5772)
Xata schema has removed the formatVersion field, including it in a schema definition results in an error.
2023-01-07 07:47:30 +01:00
Balázs Orbán
69cda58707 fix(core): move types submodule top top 2023-01-07 07:47:30 +01:00
Balázs Orbán
b20a5f554a feat(providers): add Mattermost provider (#6290)
* added mattermost provider

* upaded docs and removed callback uri

* username -> name

* updated types to match other providers

* cleanup

* add logos

* style sign-in button

* add JSDoc to profile

* add JSDoc comments

* correction

Co-authored-by: Balázs Orbán <info@balazsorban.com>
delete mattermost icons
2023-01-07 07:47:30 +01:00
Balázs Orbán
f8d77c4daf chore: hardcode issue labeler markdown path 2023-01-05 12:14:57 +01:00
Balázs Orbán
a3d23450a8 chore: fix issue labeler path 2023-01-05 12:09:44 +01:00
Balázs Orbán
9abee0b2ee chore: use import.meta.url in issue labeler 2023-01-05 12:07:44 +01:00
Balázs Orbán
5cf580d10b chore(examples): clean up example READMEs, add deploy buttons 2023-01-05 11:18:01 +01:00
Thang Vu
00d495d9e3 chore: update email script 2023-01-04 21:54:22 +07:00
Thang Vu
5884574765 chore(dev): simplify header.js component 2023-01-04 21:53:55 +07:00
Thang Vu
ae5360b028 chore: cache output for @auth/core 2023-01-04 21:52:42 +07:00
Doodles
7c963515b5 docs: Add session management example for SvelteKit (#6184)
* chore(docs): Session management sample for Svelte

Added a code sample for managing the session through the $page store.
The sample demonstrates how to retrieve the session data in the root
+page.server.ts file and make it globally accessible through the $page
store, simplifying state management in the application. The previous
examples already used the data available in this store but did not show
how to set it.

* docs: Add authorization section to SvelteKit docs

This authorization section was added to make sure a few caveats with
SvelteKit were well documented to anyone using the library.

The problem is documented here: https://github.com/sveltejs/kit/issues/6315

Essentially, propagation of data between leafs is not guaranteed when
using the +layout.server.ts file as its load function is not guaranteed
to rerun every page change. The current approach to solve this is to do
authorization in each +page.server.ts file and additionally make sure to
grab the session data by awaiting the parent instead of directly
accessing the $page store, to make sure the information there is
current.

* docs: Fix small typesafety mistake in SvelteKit

PageLoad type should actually be PageServerLoad. Not setting this does
not actually generate any problems other than TypeScript complaining
that this type is not actually exported.

* docs: Add handle hook authorization management

Another way to handle authorization is through a path-based method. This
added part of the documentation uses the handle hook to protect certain
routes based on their path. The previous method which is per-component
is still present.

* docs: Simplify component approach for Svelte auth

Using event.locals.getSession() exposed by SvelteKitAuth instead of
relying in the root layout file making that available in the $page
store.

* docs: Complete SvelteKit authorization docs

Finalize the explanation for the URI-based approach and also clarify
interactions with the component-based approach.

* docs: Add formatting to vars in the SvelteKit docs

Format the variables like this: `var` so that it appears clearly as code
when reading the documentation.

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-01-04 21:49:18 +07:00
Robin Gasi
8cf4cc2ea9 docs: Fixed typo (#6277) 2023-01-04 08:58:57 +00:00
GitHub Actions
9388a56efa chore(release): bump package version(s) [skip ci] 2023-01-04 06:56:11 +00:00
Balázs Orbán
3a75fb955a docs: simplify refresh token guide 2023-01-04 07:49:11 +01:00
Balázs Orbán
01bb91612a fix(core): allow passing params only to endpoint configs
fixes #6273
2023-01-04 07:48:57 +01:00
Balázs Orbán
3b25935c83 fix(core): correctly pass user id in account
fixes #6209, fixes #6222
2023-01-03 16:26:49 +01:00
Balázs Orbán
394920dfd4 chore(examples): prefer useSession over prop drilling
closes #5891
2023-01-03 16:07:37 +01:00
Raouf Chebri
85dc5bede8 docs: Update strava provider option url (#6264)
Update strava.md
2023-01-03 15:55:36 +01:00
Balázs Orbán
8f854c61d0 fix(core): allow custom endpoint config when issuer is present
closes #6244
2023-01-03 12:11:13 +01:00
Balázs Orbán
e8fbe58997 docs: update refresh token guide 2023-01-03 12:09:13 +01:00
Cameron Downey
d2288ee4cc fix(docs): turn SvelteKitAuth to named import in code example (#6250) 2023-01-02 10:52:47 +00:00
Thang Vu
5a6f76bf2c fix: docs build (#6253)
* fix: docs build

* chore: move next-auth output to dist

* chore: add next-auth as deps for doc

* Revert "chore: move next-auth output to dist"

This reverts commit 9596a9134e6de4f4bd8dcfaa6d3002e98863d8f8.

* remove dist prefix
2023-01-02 16:57:14 +07:00
Thang Vu
15bed6260c chore: change Thang's email 2023-01-01 22:45:36 +07:00
Balázs Orbán
1423733d61 fix(adapters): define correct peer dependencies for DynamoDB (#6249)
* Add @aws-sdk/client-dynamodb as peer dependency

* Add missing DynamoDBClientConfig interface import

* Add missing installation requirements

Co-authored-by: Didi Keke <nyedidikeke@users.noreply.github.com>
2023-01-01 15:16:01 +00:00
Thang Vu
77d8f47f51 chore: restore turborepo next-auth#build.outputs 2023-01-01 22:06:50 +07:00
Balázs Orbán
3120d28299 chore: update lockfile 2023-01-01 16:03:09 +01:00
Nico Domino
e6a320bb0f chore(docs): fix homepage logo, build, and lighthouse improvements (#6238)
* chore(docs): fix homepage logo size

* chore(docs): fix sidebars.js solid-start doc path name

* chore(docs): image file and size optimizations

* chore(docs): fix semantic misordered headings

* chore(docs): make banner link more descriptive

* chore(docs): add solid-start redirect
2022-12-31 21:28:59 +01:00
Birk Skyum
7d4d436efe chore(examples): fix broken docs link in solidstart example (#6241) 2022-12-31 21:28:17 +01:00
GitHub Actions
c6f5c4d1cf chore(release): bump package version(s) [skip ci] 2022-12-31 11:09:43 +00:00
Balázs Orbán
09a075cc7e fix(core): loosen dependency version requirements 2022-12-31 12:05:23 +01:00
Balázs Orbán
f1475955ea chore: solidstart -> solid-start 2022-12-31 11:53:29 +01:00
Balázs Orbán
e6f48775fa chore: add packages to docs build dependency list 2022-12-31 11:44:40 +01:00
Balázs Orbán
ba87e86d47 chore: update lock file 2022-12-31 11:42:08 +01:00
Balázs Orbán
b0dd1fac93 chore: disable solid start example sync (temp) 2022-12-31 11:34:49 +01:00
Balázs Orbán
054288316b chore(examples): rename solid-start to solidstart 2022-12-31 11:31:47 +01:00
Balázs Orbán
5e02019a3c chore: what is yaml 2022-12-31 10:23:17 +00:00
Balázs Orbán
9da0e66193 chore: fix indent 2022-12-31 10:20:48 +00:00
OrJDev
287c8f0f91 feat(solid-start): introduce @auth/solid-start package/example (#6158)
* feat: add solid framework package and example

* solidstart docs

* Update 02-oauth-tutorial.mdx

* minor docs fixes

* Fix sidebar typo

* Update sync.yml

* Update sidebars.js

* minor fixes

* fix deps

* upgrade auth example

* Update root.tsx

* Update NavBar.tsx

* Update Protected.tsx

* protected

* move example

* Update sidebars.js

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-12-31 10:15:31 +00:00
Balázs Orbán
87ed5077ad fix(sveltekit): make AUTH_SECRET dynamic
fixes #6231
2022-12-31 10:45:42 +01:00
Jonny
2cbf815445 fix(ts): add function overload to getToken (#5823)
* added function overload to getToken

* use MissingSecret error instead

* had wrong import

* change in core

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-31 09:26:23 +00:00
박찬혁
d63166db3a fix(ts): narrow Kakao's birtday_type profile property type (#6036)
* feat: type safety for BirthDay

* update in core

* birthday single word

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-31 08:32:26 +00:00
Håkon Collett Bjørgan
f387793d71 fix(core): clarify that JWT is encrypted by default (#5824)
* fix(core): update CallbacksOptions.jwt docstring

Change description to reflect that JWT is encrypted by default

* update in core

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-31 07:52:48 +00:00
Balázs Orbán
b0ecf4e861 chore: update lockfile 2022-12-31 08:41:32 +01:00
Balázs Orbán
5a73c6efa3 chore: clean up pr labeler 2022-12-31 08:32:48 +01:00
Thang Vu
4aec142525 chore: split apps to dev, examples, playgrounds (#6228)
* chore: dev -> dev/nextjs

* chore: move to /examples

* chore: move to playgrounds, add dev/sveltekit

* Update sync.yml

* chore: dev scripts
2022-12-31 07:17:42 +00:00
1337cookie
45f423ed5d chore: gitignore generated src/lib/pages/styles.ts (#6210)
* chore: gitignore generated src/lib/pages/styles.ts

* chore: gitignore generated styles.ts

* chore: gitignore generated styles.ts

* chore: remove generated styles.ts
2022-12-29 05:14:09 +01:00
1337cookie
2e52a89c52 docs: fix links to moved docs (#6196) 2022-12-27 16:10:31 +01:00
Zgîmbău Tudor
ecde35e9c4 docs: Fix hydration error for SSR example (#6202) 2022-12-27 16:09:10 +01:00
ndom91
5a51330d55 chore(docs): add turbo docs build dependency 2022-12-27 14:43:52 +01:00
Nico Domino
b2db3eabee chore(docs): fix build step (#6188)
* chore(docs): fix build step temporarily

* fix: turbo docs build
2022-12-27 01:10:38 +01:00
Carlos Galarza
3865e44c1e fix(core): typo in API reference (#6194) 2022-12-27 01:09:55 +01:00
Zgîmbău Tudor
9f5acc5749 docs: Fix the hooks code in oauth getting started (#6193)
* Fix the hooks code in oauth getting started

Fixes https://github.com/nextauthjs/next-auth/issues/6192

* Apply suggestions from code review

Co-authored-by: Nico Domino <yo@ndo.dev>

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-12-27 01:08:37 +01:00
Iswar Mondal
0bbc8246b8 docs: Fixed the broken link of Contributing Guide in README (#6191)
* Updated the Contributing Guide link in README file

* Replaced the Contributing Guide broken link in README
2022-12-26 19:38:33 +01:00
Thang Vu
511f66b0a8 chore: enable remote caching for GH actions (#6187) 2022-12-26 11:38:30 +00:00
Thang Vu
ae57199258 chore(examples): unify /protected path behavior for Sveltekit and N… (#6176)
chore(examples): unify `/protected` path behavior for Sveltekit and Next.js
2022-12-25 17:56:10 +07:00
Balázs Orbán
aad425fced docs: show property types 2022-12-25 09:53:53 +01:00
Balázs Orbán
8ef1010bb1 chore: attempt to fix supabase test
SUPABASE_SERVICE_ROLE_KEY could be an empty string
2022-12-25 06:38:29 +01:00
Balázs Orbán
950ca3169a chore: make supabase wget quite 2022-12-25 06:30:03 +01:00
Balázs Orbán
edbf0fc011 chore: revert concurrency 2022-12-25 06:19:20 +01:00
Balázs Orbán
46bac818fe chore: add concurrency to tests 2022-12-25 06:15:48 +01:00
Balázs Orbán
9e64eb0cdd chore: simplify turbo config 2022-12-25 06:15:27 +01:00
Balázs Orbán
955e379330 chore: format 2022-12-25 05:59:12 +01:00
Balázs Orbán
7be4461253 chore: don't minify output CSS 2022-12-25 05:58:43 +01:00
Balázs Orbán
c2e06dc445 chore: upgrade oauth4webapi 2022-12-25 05:58:08 +01:00
Balázs Orbán
4dd70a5f6f fix(ts): enable strict type checking 2022-12-25 05:55:25 +01:00
Balázs Orbán
98dbf56494 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-12-25 05:19:32 +01:00
Balázs Orbán
6b4644f7e7 chore(adapters): refactor Supabase Adapter test 2022-12-25 05:18:53 +01:00
GitHub Actions
bcf909b69e chore(release): bump package version(s) [skip ci] 2022-12-24 16:39:23 +00:00
Balázs Orbán
4dcdd21242 fix(providers): add state check to Twitter by default
Fixes #6135
2022-12-24 17:16:22 +01:00
Balázs Orbán
137d993a13 chore(dev): upgrade next 2022-12-24 17:15:35 +01:00
Balázs Orbán
8dda662cd6 chore: fix issue validator path 2022-12-24 16:43:51 +01:00
Balázs Orbán
8a438bab32 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-12-24 16:36:33 +01:00
Balázs Orbán
4aaad03e9c chore: fix issue validator 2022-12-24 16:36:30 +01:00
Fatih Aygün
4fa0d1fa2a fix(core): correctly normalize endpoint configuration (#6173) 2022-12-24 15:31:47 +00:00
Balázs Orbán
c081773667 chore: use classic PAT for example sync 2022-12-24 15:25:57 +00:00
Balázs Orbán
1ab0a2aed4 fix(adapters): correct peer dependency for Supabase Adapter
Fixes #6172
2022-12-24 15:23:29 +00:00
Balázs Orbán
cac9816d32 chore: update sync examples PAT 2022-12-24 15:19:27 +00:00
Balázs Orbán
65defc709e chore(examples): change to named import 2022-12-24 15:14:06 +00:00
Balázs Orbán
1601626d31 chore: prettier ignore generated file 2022-12-24 04:34:47 +01:00
Balázs Orbán
8c4f439279 fix: add package keywords 2022-12-24 04:32:10 +01:00
580 changed files with 17091 additions and 15204 deletions

View File

@@ -23,8 +23,8 @@ pnpm-lock.yaml
.docusaurus
build
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
docs/docs/reference/core
docs/docs/reference/sveltekit
static
# --------------- Packages ---------------

View File

@@ -30,7 +30,7 @@ body:
Run this command in your project's root folder and paste the result:
```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.
validations:

View File

@@ -25,12 +25,14 @@ body:
- "Custom provider"
- "42 School"
- "Apple"
- "Asgardeo"
- "Atlassian"
- "Auth0"
- "Authentik"
- "Azure Active Directory"
- "Azure Active Directory B2C"
- "Battlenet"
- "Beyond Identity"
- "Box"
- "Bungie"
- "Cognito"
@@ -57,6 +59,7 @@ body:
- "Medium"
- "Naver"
- "Netlify"
- "Notion"
- "Okta"
- "OneLogin"
- "Osso"
@@ -87,7 +90,7 @@ body:
Run this command in your project's root folder and paste the result:
```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.
validations:

View File

@@ -44,7 +44,7 @@ body:
Run this command in your project's root folder and paste the result:
```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.
validations:

View File

@@ -8,7 +8,7 @@ merge of your pull request!
> _NOTE_:
>
> - 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
@@ -28,7 +28,7 @@ Fixes: INSERT_ISSUE_LINK_HERE
## 📌 Resources
- [Security guidelines](../Security.md)
- [Contributing guidelines](../CONTRIBUTING.md)
- [Code of conduct](../CODE_OF_CONDUCT.md)
- [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md)
- [Contributing guidelines](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md)
- [Code of conduct](https://github.com/nextauthjs/.github/blob/main/CODE_OF_CONDUCT.md)
- [Contributing to Open Source](https://kcd.im/pull-request)

File diff suppressed because one or more lines are too long

View File

@@ -526,7 +526,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
root
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
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
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tr46
MIT

View File

@@ -14,9 +14,9 @@ Ensure the link is pointing to a codebase that is accessible (e.g. not a private
### **What happens if I don't provide a sufficient minimal reproduction?**
Issues with the `incomplete` label that receives no meaningful activity (e.g. new comments with a reproduction link) are automatically closed and locked after 30 days.
Issues with the `incomplete` label that receives no meaningful activity (e.g. new comments with a reproduction link) are closed after 7 days.
If your issue has _not_ been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction.
If your issue has _not_ been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction. (It's less likely that we check back on already closed issues.)
### **I did not open this issue, but it is relevant to me, what can I do to help?**

View File

@@ -4,6 +4,7 @@ import * as github from "@actions/github"
// @ts-expect-error
import * as core from "@actions/core"
import { readFileSync } from "node:fs"
import { join } from "node:path"
const addReproductionLabel = "incomplete"
@@ -70,7 +71,12 @@ async function run() {
}),
client.issues.createComment({
...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(

View File

@@ -1,74 +1,26 @@
# https://github.com/actions/labeler#create-githublabeleryml
test:
- test/**/*
- types/tests/**/*
providers:
- packages/next-auth/src/providers/**/*
- test/integration/**/*
adapters:
- packages/next-auth/src/adapters.ts
- packages/adapter-*/**
dgraph:
- packages/adapter-dgraph/**
dynamodb:
- packages/adapter-dynamodb/**
fauna:
- packages/adapter-fauna/**
firebase:
- packages/adapter-firebase/**
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/**/*
adapters: ["packages/core/src/adapters.ts", "packages/adapter-*/**/*"]
core: ["packages/core/src/**/*"]
dgraph: ["packages/adapter-dgraph/**/*"]
documentation: ["packages/docs/docs/**/*"]
dynamodb: ["packages/adapter-dynamodb/**/*"]
examples: ["apps/examples/**/*"]
fauna: ["packages/adapter-fauna/**/*"]
firebase: ["packages/adapter-firebase/**/*"]
frameworks: ["packages/frameworks-*/**/*"]
legacy: ["packages/next-auth/**/*"]
mikro-orm: ["packages/adapter-mikro-orm/**/*"]
mongodb: ["packages/adapter-mongodb/**/*"]
neo4j: ["packages/adapter-neo4j/**/*"]
playgrounds: ["apps/playgrounds/**/*"]
pouchdb: ["packages/adapter-pouchdb/**/*"]
prisma: ["packages/adapter-prisma/**/*"]
providers: ["packages/core/src/providers/**/*"]
sequelize: ["packages/adapter-sequelize/**/*"]
solidjs: ["packages/frameworks-solid-start/**/*"]
supabase: ["packages/adapter-supabase/**/*"]
svelte: ["packages/frameworks-sveltekit/**/*"]
test: ["**test**/*"]
typeorm-legacy: ["packages/adapter-typeorm-legacy/**/*"]
upstash-redis: ["packages/adapter-upstash-redis/**/*"]
xata: ["packages/adapter-xata/**/*"]

11
.github/sync.yml vendored
View File

@@ -1,14 +1,21 @@
# Note that nextauthjs/next-auth-example syncs from the v4 branch
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: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE
nextauthjs/next-auth-gatsby-example:
- source: apps/playground-gatsby
- source: apps/playgrounds/gatsby
dest: .
deleteOrphaned: true
- .github/FUNDING.yml

View File

@@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-node@v3
with:
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,10 +3,10 @@ name: Release
on:
push:
branches:
- "main"
- "beta"
- "next"
- "3.x"
- main
- beta
- next
- 3.x
pull_request:
jobs:
@@ -24,14 +24,32 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Run tests
run: pnpm test
timeout-minutes: 15
env:
UPSTASH_REDIS_URL: ${{ secrets.UPSTASH_REDIS_URL }}
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
# uses: codecov/codecov-action@v1
# with:
@@ -55,7 +73,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Publish to npm and GitHub
@@ -80,7 +97,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Determine version

View File

@@ -11,9 +11,9 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run GitHub File Sync
# Can update to v1 when https://github.com/BetaHuhn/repo-file-sync-action/issues/168 is resolved
uses: BetaHuhn/repo-file-sync-action@v1.16.5
uses: balazsorban44/repo-file-sync-action@master
with:
GH_PAT: ${{ secrets.SYNC_EXAMPLE_PAT }}
GH_PAT: ${{ secrets.GH_PAT }}
IS_FINE_GRAINED: true
SKIP_PR: true
ORIGINAL_MESSAGE: true

26
.gitignore vendored
View File

@@ -1,6 +1,5 @@
# Misc
.DS_Store
.npmrc
.eslintcache
.env
.env.local
@@ -12,8 +11,9 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log
ui-debug.log
.pnpm-debug.log
.husky
# Dependencies
node_modules
@@ -34,13 +34,10 @@ packages/next-auth/utils
packages/next-auth/core
packages/next-auth/jwt
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/middleware.d.ts
packages/next-auth/middleware.js
packages/*/*.js
packages/*/*.d.ts
packages/*/*.d.ts.map
# Development app
apps/dev/src/css
@@ -81,13 +78,12 @@ docs/.docusaurus
docs/providers.json
# Core
packages/core/*.js
packages/core/*.d.ts
packages/core/*.d.ts.map
packages/core/src/providers/oauth-types.ts
packages/core/lib
packages/core/providers
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
packages/core/src/lib/pages/styles.ts
docs/docs/reference/core
docs/docs/reference/sveltekit
# SvelteKit
@@ -97,3 +93,7 @@ packages/frameworks-sveltekit/.svelte-kit
packages/frameworks-sveltekit/package
packages/frameworks-sveltekit/vite.config.js.timestamp-*
packages/frameworks-sveltekit/vite.config.ts.timestamp-*
# Adapters
docs/docs/reference/adapter

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
public-hoist-pattern[]=*prisma*

View File

@@ -20,9 +20,10 @@ pnpm-lock.yaml
.docusaurus
build
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
docs/docs/reference/core
docs/docs/reference/sveltekit
static
docs/providers.json
# --------------- Packages ---------------

View File

@@ -7,10 +7,16 @@ module.exports = {
overrides: [
{
files: [
"apps/dev/pages/api/auth/[...nextauth].ts",
"apps/dev/nextjs/pages/api/auth/[...nextauth].ts",
"docs/{sidebars,docusaurus.config}.js",
],
options: { printWidth: 150 },
},
{
files: ["**/*package.json"],
options: {
trailingComma: "none",
},
},
],
}

View File

@@ -1,4 +0,0 @@
{
"typescript.tsdk": "../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}

View File

@@ -9,20 +9,39 @@ NEXTAUTH_URL=http://localhost:3000
# and/or verification tokens.
NEXTAUTH_SECRET=secret
ASGARDEO_CLIENT_ID=
ASGARDEO_CLIENT_SECRET=
ASGARDEO_ISSUER=
AUTH0_ID=
AUTH0_SECRET=
AUTH0_ISSUER=
KEYCLOAK_ID=
KEYCLOAK_SECRET=
KEYCLOAK_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=
GITHUB_ID=
GITHUB_SECRET=
KEYCLOAK_ID=
KEYCLOAK_SECRET=
KEYCLOAK_ISSUER=
LINE_ID=
LINE_SECRET=
TRAKT_ID=
TRAKT_SECRET=
TWITCH_ID=
TWITCH_SECRET=
@@ -30,11 +49,8 @@ TWITCH_SECRET=
TWITTER_ID=
TWITTER_SECRET=
LINE_ID=
LINE_SECRET=
TRAKT_ID=
TRAKT_SECRET=
WIKIMEDIA_ID=
WIKIMEDIA_SECRET=
# Example configuration for a Gmail account (will need SMTP enabled)
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
DATABASE_URL=
WIKIMEDIA_ID=
WIKIMEDIA_SECRET=
# Supabase Example Configuration
# Supabase Example Configuration
# NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
# SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSJ9.vI9obAHOGyVVKa3pD--kJlyxp-Z2zV9UUMAhKpNLAcU
# 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
View File

@@ -0,0 +1,4 @@
node_modules/
/test-results/
/playwright-report/
/playwright/.cache/

4
apps/dev/nextjs/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"typescript.tsdk": "../../../node_modules/.pnpm/typescript@4.9.4/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}

View File

@@ -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:
[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)

View File

@@ -1,5 +1,5 @@
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"
// 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}>
You are not signed in
</span>
<a
href="/api/auth/signin"
className={styles.buttonPrimary}
onClick={(e) => {
e.preventDefault()
signIn()
}}
>
<a href="/api/auth/signin" className={styles.buttonPrimary}>
Sign in
</a>
</>
@@ -47,14 +40,7 @@ export default function Header() {
<strong>{session.user.email} </strong>
{session.user.name ? `(${session.user.name})` : null}
</span>
<a
href="/api/auth/signout"
className={styles.button}
onClick={(e) => {
e.preventDefault()
signOut()
}}
>
<a href="/api/auth/signout" className={styles.button}>
Sign out
</a>
</>

View File

@@ -1,7 +1,7 @@
{
"name": "next-auth-app",
"version": "1.0.0",
"description": "NextAuth.js Developer app",
"description": "Next.js + Auth.js Developer app",
"private": true,
"scripts": {
"clean": "rm -rf .next",
@@ -9,10 +9,12 @@
"build": "next build",
"start": "next start",
"email": "fake-smtp-server",
"start:email": "pnpm email"
"start:email": "pnpm email",
"e2e": "pnpm dlx playwright test"
},
"license": "ISC",
"dependencies": {
"@auth/core": "workspace:*",
"@next-auth/fauna-adapter": "workspace:*",
"@next-auth/prisma-adapter": "workspace:*",
"@next-auth/supabase-adapter": "workspace:*",
@@ -20,17 +22,18 @@
"@prisma/client": "^3",
"@supabase/supabase-js": "^2.0.5",
"faunadb": "^4",
"next": "13.0.6",
"next": "13.1.1",
"next-auth": "workspace:*",
"@auth/core": "workspace:*",
"nodemailer": "^6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@playwright/test": "1.29.2",
"@types/jsonwebtoken": "^8.5.5",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"dotenv": "^16.0.3",
"fake-smtp-server": "^0.8.0",
"pg": "^8.7.3",
"prisma": "^3",

View File

@@ -2,9 +2,11 @@ import { Auth, type AuthConfig } from "@auth/core"
// Providers
import Apple from "@auth/core/providers/apple"
import Asgardeo from "@auth/core/providers/asgardeo"
import Auth0 from "@auth/core/providers/auth0"
import AzureAD from "@auth/core/providers/azure-ad"
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 Cognito from "@auth/core/providers/cognito"
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 LinkedIn from "@auth/core/providers/linkedin"
import Mailchimp from "@auth/core/providers/mailchimp"
import Notion from "@auth/core/providers/notion"
// import Okta from "@auth/core/providers/okta"
import Osu from "@auth/core/providers/osu"
import Patreon from "@auth/core/providers/patreon"
@@ -68,7 +71,7 @@ import WorkOS from "@auth/core/providers/workos"
export const authConfig: AuthConfig = {
// adapter,
// debug: process.env.NODE_ENV !== "production",
debug: process.env.NODE_ENV !== "production",
theme: {
logo: "https://next-auth.js.org/img/logo/logo-sm.png",
brandColor: "#1786fb",
@@ -82,6 +85,7 @@ export const authConfig: AuthConfig = {
},
}),
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 }),
AzureAD({
clientId: process.env.AZURE_AD_CLIENT_ID,
@@ -89,6 +93,7 @@ export const authConfig: AuthConfig = {
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 }),
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" }),
// 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 }),
@@ -105,6 +110,7 @@ export const authConfig: AuthConfig = {
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 }),
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 }),
Osu({ clientId: process.env.OSU_CLIENT_ID, clientSecret: process.env.OSU_CLIENT_SECRET }),
Patreon({ clientId: process.env.PATREON_ID, clientSecret: process.env.PATREON_SECRET }),

View 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;

View 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()
})

View File

@@ -1,4 +1,8 @@
{
"name": "sveltekit-auth-app",
"version": "1.0.0",
"description": "SvelteKit + Auth.js Developer app",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
@@ -15,8 +19,8 @@
"vite": "4.0.1"
},
"dependencies": {
"@auth/core": "latest",
"@auth/sveltekit": "latest"
"@auth/core": "workspace:*",
"@auth/sveltekit": "workspace:*"
},
"type": "module"
}

View File

@@ -1,4 +1,4 @@
import SvelteKitAuth from "@auth/sveltekit"
import { SvelteKitAuth } from "@auth/sveltekit"
import GitHub from "@auth/core/providers/github"
import { GITHUB_ID, GITHUB_SECRET } from "$env/static/private"

View File

@@ -2,9 +2,18 @@
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}

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

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

View File

@@ -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 {}
}

View File

@@ -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">
<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>
<a href="https://authjs.dev" target="_blank">
<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">
Open Source. Full Stack. Own Your Data.
</p>
@@ -25,20 +30,14 @@
## 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.
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.
> _NextAuth.js is not officially associated with Vercel or Next.js._
## Getting Started
### 1. Clone the repository and install dependencies
@@ -98,15 +97,13 @@ npm run start
### 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)
[![Deploy with Vercel](https://vercel.com/button)](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
<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>
<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
<p align="left">Thanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire Auth.js Team</p>

Some files were not shown because too many files have changed in this diff Show More