Compare commits

..

176 Commits

Author SHA1 Message Date
Simone Ruberto
93f9153d77 docs: fix Broken link (#8935) 2023-10-24 20:25:42 +02:00
Thang Vu
2c43f83fa6 chore(release): bump version [skip ci] 2023-10-18 22:05:32 +07:00
Thang Vu
7446969587 fix: css build error 2023-10-18 22:04:55 +07:00
Thang Vu
701edba1c1 chore(release): bump version [skip ci] 2023-10-18 21:57:34 +07:00
Thang Vu
8141c7e217 fix: css build error 2023-10-18 21:55:25 +07:00
Thang Vu
ab3f78bbae chore(release): bump version [skip ci] 2023-10-18 21:36:50 +07:00
Thang Vu
ff4519bdda chore: only build next-auth in v4 2023-10-18 21:31:36 +07:00
Thang Vu
52a93d0409 fix: css build error 2023-10-18 21:31:24 +07:00
Thang Vu
39ecfbd255 chore(release): bump version [skip ci] 2023-10-18 21:07:53 +07:00
Thang Vu
a39d35b341 feat: tweak default sign-in page (#8888) 2023-10-18 20:52:54 +07:00
Balázs Orbán
1cee92563f docs: Update sidebars.js 2023-10-16 15:04:51 +01:00
Balázs Orbán
e3845270c6 docs: add sponsor 2023-10-10 15:59:08 +02:00
Thang Vu
2510f74809 chore(release): bump version [skip ci] 2023-10-02 18:57:37 +07:00
Thang Vu
27b2519b84 fix(next): returns correct status for signing in with redirect: false for route handler (#8775)
* fix: returns status for signing in with credentials provider `redirect: false`

* chore: format cookie.ts
2023-10-02 18:48:36 +07:00
Ahmed Abdelbaset
5f15b0704a docs: fix typo (#8767)
fix typo
2023-10-02 01:03:25 +01:00
Balázs Orbán
e4573ffff5 docs: typo 2023-10-02 01:37:14 +02:00
Balázs Orbán
4ce1951a2b docs: close admonition 2023-10-02 01:34:55 +02:00
Balázs Orbán
c95531d651 docs: mention auth() convention under getServerSession 2023-10-02 01:32:35 +02:00
Balázs Orbán
654d52bb56 docs: mention getServerSession under SessionProvider 2023-10-02 01:27:35 +02:00
Herbie Vine
b72d7be9be docs: set decode fn not jwt obj (#8742)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-09-29 15:36:32 +02:00
Balázs Orbán
76fcc4e70c chore: don't sync example from v4 branch 2023-09-27 12:49:25 +02:00
Balázs Orbán
4cacf504dd docs: clarify pages in middleware 2023-09-26 13:23:04 +02:00
Balázs Orbán
50eb23f626 fix: update security policy link 2023-09-25 11:30:27 +02:00
Balázs Orbán
d813c00b3e fix(ts): fix typo 2023-09-20 19:48:30 +01:00
Soheil Nazari
fc4448a85a docs: add extra tips for next app router (#8227)
* Update example.md

* Update example.md

* Update example.md

* Update docs/docs/getting-started/example.md

* Update docs/docs/getting-started/example.md

* Update docs/docs/getting-started/example.md

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-20 13:46:47 +07:00
Thang Vu
16f781c091 chore: update email 2023-09-16 12:07:27 +07:00
Jared Wyce
ebfdaece0e fix: remove trailing ? from signIn URL (#8466)
* fix: 🎣 avoid phishing categorization by VPNs

* Update packages/next-auth/src/react/index.tsx

* Update packages/next-auth/src/react/index.tsx

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-06 12:55:03 +07:00
Devdat Kumar
64a190e549 docs: Update adapters.md (#8397)
"Drizzle" and "Kysely" links have been added to the list, and the list has been sorted.

https://next-auth.js.org/adapters
2023-08-24 10:23:41 +01:00
Arif Shanji
e11f898c10 docs: typo (#8366) 2023-08-21 13:53:35 +02:00
Balázs Orbán
dcb11da2e2 docs: update error page
closes #8174
2023-08-18 09:22:25 +01:00
Thang Vu
9f900befe6 chore(release): bump version [skip ci] 2023-08-16 14:43:26 +07:00
Gabriel Villenave
09c2a89df8 fix: use default submodules export in package.json (#8330)
Use `default` submodules export in `package.json` to ensure compatibility, as specified in https://nodejs.org/api/packages.html#conditional-exports
2023-08-16 09:33:07 +02:00
Balázs Orbán
20c3fe3331 fix(ts): correctly expose next-auth/adapters
Fixes https://github.com/nextauthjs/next-auth/issues/8283#issuecomment-1675939280
2023-08-12 16:37:18 +02:00
Manuel Cattelan
e26f500d18 docs(providers): add warning for gitlab provider (#8292) 2023-08-11 13:56:56 +02:00
Balázs Orbán
494d16e54d chore(release): bump version [skip ci] 2023-08-11 13:43:03 +02:00
Balázs Orbán
5a8aa2e5e5 feat(providers): add Passage by 1Password 2023-08-11 13:39:52 +02:00
Balázs Orbán
05ff6ae221 fix(ts): correctly export submodule types 2023-08-11 11:31:35 +02:00
Jonathan Edenström
1fbc684f53 fix: sort cookie chunks correctly (#8284) 2023-08-10 12:17:41 +01:00
Balázs Orbán
124be4fb1f chore(release): bump version [skip ci] 2023-08-08 19:21:49 +02:00
Balázs Orbán
3b0128c3ca fix(ts): match next-auth/adapter & @auth/core/adapters 2023-08-08 19:20:30 +02:00
Balázs Orbán
36b97aafb8 docs: amplify note 2023-08-08 18:00:41 +02:00
Thang Vu
175d37499b chore(release): bump version [skip ci] 2023-08-06 22:52:13 +07:00
Thang Vu
08a6835a70 fix: don't return res.end() in api handler (#8244)
Move #8069 to v4 branch
co-authored by @maritz

Co-authored-by: maritz <159633+maritz@users.noreply.github.com>
2023-08-06 22:38:57 +07:00
Thang Vu
448a11ff0a chore: add turbo env vars 2023-08-06 21:47:08 +07:00
Thang Vu
f39f9708bd fix(ts) : add missing function overload for Route Handler (#8236)
Pick up https://github.com/nextauthjs/next-auth/pull/8211 & tweak some changes

Co-authored-by: Max Quinn <max.t.quinn@gmail.com>
2023-08-05 19:57:29 +07:00
Matt Azlin
6d98b8b33c docs: fixing broken link in documentation (#8208) 2023-08-03 16:11:11 +02:00
Balázs Orbán
ef7ec044c5 docs: clarify getServerSession 2023-08-03 16:05:32 +02:00
Balázs Orbán
e89e3143d7 docs: move unstable_getServerSession 2023-08-03 16:03:48 +02:00
Noam Al Rifaï
12f0795a0a docs: Typo fixed (#8206) 2023-08-03 16:01:58 +02:00
Trent
9e0036bc73 docs(providers): mention HTTP-based Email guide (#8214)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-08-03 15:57:57 +02:00
MohammadAli Saeidi
27aa5ef09b docs: Update object key "email" to "username" (#8113) 2023-07-25 14:45:38 +02:00
Thang Vu
903bd6fac9 fix: remove RSC warning in getServerSession (#8108) 2023-07-25 12:13:51 +02:00
Ricardo van Noort
998b7a0db4 docs: Update upgrade-to-v4.md (#8123) 2023-07-25 12:12:57 +02:00
Thang Vu
465644f9e4 fix(ts): SignInResponse.error type (#8109)
Co-authored-by: smcg468 <49883535+smcg468@users.noreply.github.com>
2023-07-22 12:39:23 +07:00
GhibliMagic
d12bd5a799 doc: Add a guide on sending magic links to existing users only (#7663) 2023-07-22 11:57:52 +07:00
Tony Worm
3897d47db2 docs: Update refresh-token-rotation.md - fix example client code filename (#8088) 2023-07-20 01:09:06 +02:00
Doug
e44dccc42d docs(providers): updated docs with missing account attribute (#8084) 2023-07-19 15:24:41 +02:00
Balázs Orbán
733a81bd3a chore(release): bump version [skip ci] 2023-07-18 22:53:27 +02:00
Balázs Orbán
f06f3bbc96 chore(release): bump version [skip ci] 2023-07-18 15:53:30 +02:00
Thang Vu
aea27a1fa8 fix: remove unused TS types 2023-07-16 22:32:55 +07:00
Thang Vu
bd37c55241 fix(ts): adapter interface (#8054) 2023-07-16 20:47:18 +07:00
Rexford Essilfie
169a5230db fix(ts): add overloads to withAuth middleware (#7999)
* fix(ts): add overloads to withAuth middleware

* fix: allow extends Request on returned middleware handler

* chore: simplify return type for withAuth returning middleware

* chore: remove withAuth overloads generics

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-07-12 10:49:50 +07:00
Francis Gulotta
f48eb0478e fix(providers): fix nodemailer/required types (#7950)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-07-11 12:57:37 +02:00
Stephen Cronin
b25a090c17 docs: fix getServerSession API Routes example (#7978)
* Fix Next.js getServerSession API Routes example

Example API code threw an error in Next.js. Fixed the example to work.

* Update docs/docs/configuration/nextjs.md

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-07-09 14:03:02 +02:00
Matt Jared
0167e9368b docs: Update example.md (#7879) 2023-06-27 14:29:17 +02:00
Mikalai S
dcb576f01b docs: Mention a possible cause of ResourceNotFound issue (#7758) 2023-06-09 14:56:55 +02:00
Balázs Orbán
9417822a41 Update oauth.ts
Closes #7608

Co-authored-by: aaazzz <akrm@hey.com>
2023-06-01 11:17:23 +01:00
Balázs Orbán
14f8f0cb58 docs: rephrase
Closes #7531

Co-authored-by: Trey Speakman
 <100887275+treyspeakman@users.noreply.github.com>
2023-05-19 00:58:27 +01:00
Nick Radford
212272a839 docs: Update sub-bullet about vercel deployment specifics (#7537) 2023-05-14 12:59:49 +02:00
Balázs Orbán
a8e8b7542c docs: Update initialization.md 2023-05-11 23:30:53 +01:00
browny
14cecb9b73 docs: update react docs link (#7521) 2023-05-11 14:45:39 +02:00
Ivan Medina
28bec0fbcc docs: Update client.md (#7458) 2023-05-06 12:09:10 +01:00
Thang Vu
bc683a5b72 chore: merge changes back to v4 (#7430)
* docs: Remove --save from install command (#7277)

Remove --save from install command

--save is no longer needed on npm install.

* chore: fix "Contributing guide" link (#7279)

* fix: detect origin when `instanceof Request` check fails (#7303)

* docs: Update Clerk sponsorship URL (#7305)

- Change Clerk URL from `https://clerk.dev` to `https://clerk.com`

- Fix alt from copy/paste

* chore: bump react types

* fix(docs): fix default `maxAge` formula (#7406)

* Update pnpm-lock.yaml

* sync package.json change

---------

Co-authored-by: Chris Hayes <6013871+Christopher-Hayes@users.noreply.github.com>
Co-authored-by: Raul <57044803+Leprekus@users.noreply.github.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Nick Parsons <nparsons08@gmail.com>
Co-authored-by: Victor <saptefrativictor@gmail.com>
2023-05-04 20:05:33 +01:00
Sebastián Iturra
e7b8597f73 docs: Update email.md (#7391) 2023-04-28 13:53:27 +01:00
Kjetil Hårtveit
5c89a21bfa docs: mention caching in App Router (#7206)
I spent at least a day figuring out why my tRPC caches were all [MISSing](https://vercel.com/docs/concepts/edge-network/caching#miss) even though I set the correct Cache-Control headers (my stack: NextAuth, NextJS, tRPC, Vercel). I wish information could be placed where appropriate so that others don't need to debug like I had too.

I realise it's a bit convoluted as tRPC suggested I could fetch the session in the context and then use it throughout my routers. It was not obvious to me that this caused all the public caches to fail, even on query procedures that were not using the session. The caches were MISSing because `getServerSession` refreshes the cookies via the `set-cookie` header and [Vercel won't allow this](https://vercel.com/docs/concepts/functions/serverless-functions/edge-caching). I'm not saying the refreshing of cookies is wrong, it's a nice feature, and it's kind of handy this implicitly means Vercel doesn't cache. 

So how I got here has many causes and it's futile to find anyone to "blame". The factors are:
- tRPC suggests `getSession()` in their [documentation for context](https://trpc.io/docs/server/context). 
- I see tRPC does not suggest `getSession()` in the page for [caching](https://trpc.io/docs/server/caching) which is correct but wasn't obvious to me what I had done wrong.
- my misunderstanding about the link between session and personalized data (it makes sense to me now but it wasn't that obvious to see the link: get session means no public cache)
2023-04-26 13:05:01 +01:00
Andreas Jagiella
6e9c8b5b3c docs(providers): mention non-standard properties (#7290)
~ needed database entries
~ type of redirect uri
2023-04-26 13:03:08 +01:00
Ilya
91a9e5f601 docs(providers): update default vk provider version and options link (#7354)
Update version by default and options link

Now by default VK provider uses `5.131` version.
And provider options link changed to .ts.
2023-04-26 12:58:09 +01:00
Balázs Orbán
cb916f4848 docs: Update typescript.md
closes #7288
2023-04-17 21:01:11 +01:00
muoi
8259cd4fc6 docs : fix typo (#7258)
Update link to Kakao Provider options
2023-04-17 10:35:15 +01:00
Dorijan Hašpl
7a8c0068c4 docs: mention Route Handler initialization in getting started (#7213)
Updated the Getting Started documentation file (section about adding NextAuth API routes) to refer to another documentation section where the NextAuth API routes are handled using the new App Router and Route Handlers
2023-04-12 11:39:09 +01:00
Balázs Orbán
6edb6ddaaf fix: respect protocol too, when host is trusted (#7214)
* fix: respect protocol too when host is trusted

* simplify
2023-04-12 11:30:20 +01:00
Balázs Orbán
0711d32a00 chore(release): bump version [skip ci] 2023-04-09 11:54:51 +02:00
Balázs Orbán
c261af4695 feat: support Route Handlers (#6777)
* feat: support Route Handlers

* update dev app

* init NextAuth via Route Handler in dev app

* import as type

* fix labeler

* default secret to `NEXTAUTH_SECRET`

* handle redirects

* support advanced init in Route Handlers

* use port 3000 for docs dev

* document initialization with Route Handlers

* upgrade to latest `next`

* upgrade to 13.3.0

* remove workaround

* cleanup
2023-04-09 10:51:49 +01:00
Balázs Orbán
d69f311ddc chore(release): bump version [skip ci] 2023-04-03 12:15:24 +02:00
Julius Marminge
ec8a34308b fix(ts): revert session callback type changes (#7136)
Fixes https://github.com/t3-oss/create-t3-app/issues/1328
2023-04-03 12:14:24 +02:00
Balázs Orbán
c0bf2f15fb chore(release): bump version [skip ci] 2023-04-02 11:30:53 +02:00
Thang Vu
d8901777bf fix: revert #6814 (#7125) 2023-04-02 11:27:52 +02:00
Balázs Orbán
319f2ce165 fix(ts): mark id in updateUser as always defined
Closes #7027
2023-03-29 14:16:58 +02:00
Balázs Orbán
2d907f0004 feat: make it possible to update the session (#7056) 2023-03-29 05:43:48 +02:00
JakobSchlichting
2954588be7 docs: fix typo (#7094) 2023-03-29 05:39:57 +02:00
Balázs Orbán
4026183411 docs: fix adapters links 2023-03-27 01:48:23 +02:00
Abdulaziz Askaraliev
86d031faba fix(providers): add types for yandex provider (#7073)
* fix(providers): yandex add types

* chore(providers): yandex added comments

* Update yandex.ts

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-27 00:39:54 +01:00
Thomas Knickman
1e3745d22a chore(docs): update broken links (#7069)
fix(docs): update broken links
2023-03-26 21:51:05 +02:00
Balázs Orbán
feaeda9e2a chore: release with declaration maps 2023-03-25 16:18:38 +01:00
Balázs Orbán
e127600ad4 chore: fix tests 2023-03-25 15:37:17 +01:00
Balázs Orbán
cb3137133c docs: fix title 2023-03-25 13:46:35 +01:00
Balázs Orbán
b3eaf6329e docs: fix broken links 2023-03-25 13:22:56 +01:00
Peter
8aa1789697 fix(oauth): allow jwks_uri to be set for non-wellKnown (#7014)
fix(oauth): allow jwks_uri to be set for non-wellKnown flow by passing jwks_endpoint

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-03-25 18:57:22 +07:00
Balázs Orbán
a7601d0b45 chore: redirect rest of the adapters 2023-03-24 01:57:41 +01:00
Balázs Orbán
bb8d826bc7 Update sidebars.js 2023-03-20 20:43:03 +00:00
Balázs Orbán
f787809cd4 Update overview.md 2023-03-20 20:36:47 +00:00
Balázs Orbán
7789fa17b5 Delete pouchdb.md 2023-03-20 20:36:34 +00:00
Balázs Orbán
740c505901 Update vercel.json 2023-03-20 20:36:06 +00:00
Balázs Orbán
1e579cbaa6 Merge branch 'v4' of github.com:nextauthjs/next-auth into v4 2023-03-16 03:21:37 +01:00
Balázs Orbán
65aacbe97a docs: fix links 2023-03-16 03:21:33 +01:00
Balázs Orbán
7dbfa5da4d docs: fix sidebar, remove duplicates 2023-03-16 03:13:36 +01:00
Balázs Orbán
98bd774b75 Update vercel.json 2023-03-16 01:51:34 +00:00
Norbert Hüthmayr
3661ca68b0 doca: Prevent Stalled Request Warning (#6967)
Added call to end()

Missing end causes `stalled request` warning
2023-03-16 01:30:12 +01:00
Balázs Orbán
7ba986b01e Update vercel.json 2023-03-09 11:34:27 +00:00
Balázs Orbán
e638ec5eb1 chore: redirect to new reference page 2023-03-09 11:25:25 +00:00
Abheek Dhawan
7327468697 docs: remove incorrect space in MikroORM (#6886) 2023-03-08 16:56:26 +00:00
Balázs Orbán
9a9c24897d docs: redirect prisma 2023-03-05 17:20:30 +01:00
Balázs Orbán
e362653819 chore: format 2023-03-05 16:08:35 +01:00
Balázs Orbán
a92e348ed3 chore: remove duplicate articles 2023-03-05 15:56:43 +01:00
Balázs Orbán
ab0857a99e chore: correct ts import 2023-03-02 20:32:28 +01:00
Balázs Orbán
50b117dfbb chore(release): bump version [skip ci] 2023-03-02 20:08:55 +01:00
Balázs Orbán
e6590ffc20 fix: unify checks 2023-03-02 20:08:28 +01:00
Balázs Orbán
26c846594f chore(release): bump version [skip ci] 2023-03-02 01:53:44 +01:00
Balázs Orbán
2432ce9001 fix: throw error on missing state 2023-03-02 01:50:05 +01:00
Anthony Jocks
0a689b4f4e docs: typo in faq.md (#6826) 2023-02-28 12:53:44 +01:00
Thang Vu
2fb34bab51 feat: priortize NEXTAUTH_URL_INTERNAL (#6814) 2023-02-25 18:51:16 +00:00
Olabode Lawal-Shittabey
d0e7689d07 docs: fix typo on 'nextjs#getserversession' page (#6790) 2023-02-23 14:56:58 +01:00
Balázs Orbán
c004659174 docs: add IDS6 documentation 2023-02-22 02:00:56 +00:00
Tom
c212e96f83 docs(providers): fix broken sudo pipe in hostname example (#6769)
`sudo echo > /etc/hosts` attempts to write to /etc/hosts as a non-priv user, which will fail. `echo | sudo tee /etc/hosts` works.
2023-02-22 01:49:05 +00:00
Balázs Orbán
d41f2a4a02 docs: fix typo 2023-02-21 18:28:05 +01:00
Raúl Marín
5ecf20a804 fix: Add missing logo to Default Signin Page (#6728)
fix(packages\next-auth\src\core\pages\signin.tsx): add missing logo
2023-02-17 10:23:10 +07:00
Steve Fuller
9e423f3252 docs: Update custom sign in getProvider example (#6706)
According to the function declaration for [getProviders()](https://github.com/nextauthjs/next-auth/blob/v4/packages/next-auth/src/react/index.tsx#L187) it doesn't accept any parameters. Therefore have removed passing of an argument in the doc example.

Using the documentation as is will result in multiple type errors as [referenced in an issue I've posted about](https://github.com/nextauthjs/next-auth/issues/6704)
2023-02-13 12:56:10 +00:00
Jiří Hofman
cf810f246a docs: fix wording for deployment on Vercel preview (#6705) 2023-02-13 12:50:14 +00:00
Balázs Orbán
05fe398b1a docs: redirect to new refresh token article 2023-02-10 11:59:18 +01:00
Balázs Orbán
8659c02366 docs: stop encouraging adding providers to legacy 2023-02-10 02:01:10 +01:00
Balázs Orbán
2e039643b6 docs: fix path
closes #6663
2023-02-10 01:59:41 +01:00
Balázs Orbán
3943f9b7b2 fix(next-auth): remove engines requirement on openid-client (#6654) 2023-02-09 01:52:50 +01:00
Balázs Orbán
f2e85c2113 chore: redirect to more up-to-date docs 2023-02-05 15:13:14 +01:00
Robin
c53c868288 docs: update pages configuration example to typescript (#6596)
* Update examples to TS

* docs: update files names to corresponding TSX

having jsx syntax, file needs to be jsx/tsx.

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-03 13:59:36 +00:00
Balázs Orbán
0bc4fcb51a docs: clarify token and user in session callback
closes #6602
2023-02-03 13:52:12 +00:00
Ojoechem Chinonso
139c2edb50 docs: redirect from custom sign in page if signed in (#6589)
* Add success handler to getServerSideProps

This change adds a code that gives the user a sense of direction on what to do if the OAuth sign in is successful.

* Update docs/docs/configuration/pages.md

This is noted

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

* Update getSession to getServerSession

Change the getSession in getServerSideProps to the new getServerSession

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-03 12:59:22 +00:00
Balázs Orbán
4e94d89554 chore(release): bump version 2023-02-02 02:16:28 +01:00
Balázs Orbán
43d66fcb23 fix(ts): stop using typeof + generic together (#6595) 2023-02-02 02:15:43 +01:00
Thang Vu
bfcf1a3604 chore(release): bump version [skip ci] 2023-01-31 19:25:50 +07:00
Thang Vu
5b1555ed97 feat: redesign all default pages
sync from core via #5825

Co-Authored-By: Rein Undheim <46612252+Gawdfrey@users.noreply.github.com>
2023-01-31 17:40:46 +07:00
Vu Van Dung
0ed07b31b6 fix(ts): correctly type unstable_getServerSession (#6560)
* fix: type of unstable_getServerSession

Signed-off-by: Vu Van Dung <me@joulev.dev>

* Apply suggestions from code review

---------

Signed-off-by: Vu Van Dung <me@joulev.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-01-30 12:10:26 +00:00
OrJDev
2311be7589 docs: Remove the unstable note. (#6537) 2023-01-28 15:15:09 +01:00
Balázs Orbán
e847b3466f chore(release): bump version [skip ci] 2023-01-28 13:24:50 +01:00
Balázs Orbán
8df6d5b469 feat: make generateSessionToken awaitable (#6536)
Co-authored-by: @HommeSauvage
2023-01-28 12:19:32 +00:00
Balázs Orbán
0bcaeca369 feat: remove unstable_ prefix getServerSession (#6535)
* feat: remove `unstable_` prefix from `getServerSession`

* fix test

* fix lint
2023-01-28 12:12:00 +00:00
Balázs Orbán
4f5ddbcb76 fix(oauth1): pass oauth_token_secret (#6534)
* Pass oauth_token_secret in OAuth 1.0 calls

* simplify

* simplify

---------

Co-authored-by: dawidos234 <dawidos234@gmail.com>
2023-01-28 09:44:23 +00:00
Balázs Orbán
0cbeb4055e chore(release): bump version 2023-01-24 14:03:59 +01:00
Balázs Orbán
5a128db369 fix(providers): add slash to default logo urls
fixes #6495
2023-01-24 14:03:40 +01:00
Balázs Orbán
c385cf8c7c chore(release): bump version [skip ci] 2023-01-24 02:47:03 +01:00
Balázs Orbán
53fa46744c chore: match core 2023-01-24 02:40:29 +01:00
StachowiakDawid
451eaaabd2 fix: Allow adding own logo to provider (#6465) 2023-01-24 02:35:30 +01:00
Balázs Orbán
f54424c216 fix(next-auth): remove engines 2023-01-24 02:24:45 +01:00
Balázs Orbán
09bcc1d504 fix(providers): default image to null for Azure AD
Fixes #6482
2023-01-24 02:24:35 +01:00
Chiemerie Arum
6ecf9cb93d docs(client): Improve grammar (#6444)
Improve grammar
2023-01-20 11:14:40 +00:00
Judicael
ba2711d279 docs: Remove Demo Identity server 4 (#6354)
Since the demo is not working anymore (removed), we should remove the demo identity server from the docs
2023-01-10 12:05:59 +00:00
Balázs Orbán
03881bf98f chore: fix sync GH Action pat 2023-01-07 08:29:07 +01:00
Balázs Orbán
230164f751 chore: bump version [skip release] 2023-01-07 08:22:24 +01:00
Balázs Orbán
fecf5e0a1c chore: bump monorepo release script 2023-01-07 08:21:32 +01:00
Balázs Orbán
400d0f1842 fix: move logos 2023-01-07 08:18:35 +01:00
Luis Cadillo
39657bf06c docs: remove outdated nested middleware info (#5181)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-31 09:36:53 +00:00
Nicholas
d1dd8d95c4 chore(docs): fix middleware verbiage (#5981)
* Make documentation easier to understand

* Apply suggestions from code review

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

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-31 08:33:36 +00:00
Jesús Ferretti
554ec439c9 fix(docs): import NextAuth correctly (#6206)
fix(docs): fix typo
2022-12-27 23:50:33 +01:00
Iswar Mondal
8e4db3899a docs: Replaced the word peer dependency (#6197) 2022-12-27 14:27:31 +01:00
Rob Hyrkiel
444b99ee96 docs: fix broken links related to issue #6157 (#6183) 2022-12-26 11:45:10 +01:00
Nico Domino
f12b527300 chore(docs): fix aloglia docusaurus.config.js settings (v4) (#6160)
chore(docs): fix docusaurus algolia config
2022-12-23 12:39:47 +01:00
Balázs Orbán
ac48211967 chore: fix edit link
Mentioned in #6142
2022-12-22 15:48:39 +00:00
Balázs Orbán
2bd60f6626 chore(release): bump version 2022-12-22 00:56:48 +01:00
Balázs Orbán
a83573ed2f fix(next-auth): revert to 4.17 to fix host issues but keep other fixes (#6132)
* fix(next-auth): revert to 4.17 and replay other fixes

* revert line change

* replay some TS changes to reduce diff

* fix tests

* revert more renames

* revert renames

* fix test, cleanup
2022-12-21 23:48:38 +00:00
Mark Scerri
6242aa7ecb fix: incorrect signin redirect url on session required (#5976)
Fixes https://github.com/nextauthjs/next-auth/issues/5296
2022-12-19 14:26:02 +01:00
Balázs Orbán
54cbbadc8f chore: run release on v4 branch 2022-12-19 13:24:26 +00:00
Balázs Orbán
fd4af6512e chore: remove new stuff from v4 branch 2022-12-17 20:42:10 +01:00
ndom91
6482e359b7 fix: update aloglia index name for next-auth-v4 2022-12-15 21:51:32 +01:00
Balázs Orbán
64aac2efc0 docs: fix links 2022-12-13 23:42:47 +01:00
Balázs Orbán
df37a24c23 docs: remove unreleased 2022-12-13 23:33:00 +01:00
ndom91
8bcdf8e818 chore: empty2 2022-12-13 23:15:07 +01:00
ndom91
dd765a1b45 chore: empty 2022-12-13 23:13:36 +01:00
783 changed files with 24652 additions and 30488 deletions

View File

@@ -1,70 +0,0 @@
.eslintrc.js
.cache-loader
.DS_Store
.pnpm-debug.log
.turbo
.vscode/generated*
/_work
/actions-runner
node_modules
patches
pnpm-lock.yaml
.github/actions/issue-validator/index.mjs
*.cjs
*.js
*.d.ts
*.d.ts.map
.svelte-kit
.next
.nuxt
# --------------- Docs ---------------
.docusaurus
build
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
static
# --------------- Packages ---------------
coverage
dist
# @auth/core
packages/core/src/providers/oauth-types.ts
packages/core/src/lib/pages/styles.ts
# @auth/sveltekit
packages/frameworks-sveltekit/package
packages/frameworks-sveltekit/vite.config.{js,ts}.timestamp-*
# next-auth
packages/next-auth/src/providers/oauth-types.ts
packages/next-auth/css/index.css
# Adapters
.branches
db.sqlite
dev.db
dynamodblocal-bin
firebase-debug.log
firestore-debug.log
migrations
test.schema.gql
# --------------- Apps ---------------
# Examples should have their own Prettier config since they are templates too
apps/example-sveltekit
# Development app
apps
# --------------- Tests ---------------
# TODO: these should be linted
packages/**/*test*

View File

@@ -1,75 +1,41 @@
// @ts-check
const path = require("path")
/** @type {import("eslint").ESLint.ConfigData} */
module.exports = {
env: { browser: true, es2022: true, node: true },
extends: ["eslint:recommended", "prettier"],
root: true,
parser: "@typescript-eslint/parser",
overrides: [
{
files: ["*.ts", "*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./packages/**/tsconfig.json", "./apps/**/tsconfig.json"],
},
settings: { react: { version: "18" } },
extends: [
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"standard-with-typescript",
"prettier",
],
extends: ["standard-with-typescript", "prettier"],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/method-signature-style": "off",
camelcase: "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/restrict-template-expressions": "off",
},
},
{
files: ["*.test.ts", "*.test.js"],
extends: ["plugin:jest/recommended"],
env: { jest: true },
},
{
files: ["docs/**"],
plugins: ["@docusaurus"],
extends: ["plugin:@docusaurus/recommended"],
},
{
// TODO: Expand to all packages
files: ["packages/{core,sveltekit}/*.ts"],
plugins: ["jsdoc"],
extends: ["plugin:jsdoc/recommended"],
rules: {
"jsdoc/require-param": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-jsdoc": [
"warn",
{ publicOnly: true, enableFixer: false },
parserOptions: {
project: [
path.resolve(__dirname, "./packages/**/tsconfig.eslint.json"),
path.resolve(__dirname, "./packages/frameworks/**/tsconfig.json"),
path.resolve(__dirname, "./apps/**/tsconfig.json"),
],
"jsdoc/no-multi-asterisks": ["warn", { allowWhitespace: true }],
"jsdoc/tag-lines": "off",
},
},
{
files: ["packages/frameworks-sveltekit"],
plugins: ["svelte3"],
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
settings: {
"svelte3/typescript": () => require("typescript"),
},
parserOptions: { sourceType: "module", ecmaVersion: 2020 },
env: { browser: true, es2017: true, node: true },
},
],
parserOptions: {
sourceType: "module",
ecmaVersion: "latest",
ecmaFeatures: { jsx: true },
extends: ["prettier"],
globals: {
localStorage: "readonly",
location: "readonly",
fetch: "readonly",
},
root: true,
rules: {
camelcase: "off",
},
plugins: ["jest"],
env: {
"jest/globals": true,
},
ignorePatterns: [".eslintrc.js"],
}

View File

@@ -1 +1 @@
blank_issues_enabled: false
blank_issues_enabled: false

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](https://github.com/nextauthjs/.github/blob/main/SECURITY.md) to disclose the issue to us confidentially.
> - Please make sure that you are _NOT_ opening a PR to fix a potential security vulnerability. Instead, please follow the [Security guidelines](../Security.md) to disclose the issue to us confidentially.
## ☕️ Reasoning
@@ -28,7 +28,7 @@ Fixes: INSERT_ISSUE_LINK_HERE
## 📌 Resources
- [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)
- [Security guidelines](../Security.md)
- [Contributing guidelines](../CONTRIBUTING.md)
- [Code of conduct](../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) 2022-2023, Balázs Orbán
Copyright (c) 2018-2021, Iain Collins
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,7 +540,6 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tr46
MIT

View File

@@ -35,3 +35,4 @@ Upvoting issues to show your interest will help us prioritize and address them a
- [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve)
- [Reporting a NextAuth.js bug](https://github.com/nextauthjs/next-auth/blob/main/.github/ISSUE_TEMPLATE/1_bug_framework.yml)
- [How to Contribute to Open Source (Next.js)](https://www.youtube.com/watch?v=cuoNzXFLitc)

View File

@@ -7,6 +7,8 @@ import { readFileSync } from "node:fs"
import { join } from "node:path"
const addReproductionLabel = "incomplete"
const __dirname =
"/home/runner/work/nextauthjs/next-auth/.github/actions/issue-validator"
/**
* @typedef {{
@@ -41,13 +43,7 @@ async function run() {
label: { name: newLabel },
} = payload
if (
pull_request ||
!issue?.body ||
!process.env.GITHUB_TOKEN ||
!process.env.GITHUB_ACTION_PATH
)
return
if (pull_request || !issue?.body || !process.env.GITHUB_TOKEN) return
const labels = issue.labels.map((l) => l.name)
// const isBugReport =
@@ -77,10 +73,7 @@ async function run() {
}),
client.issues.createComment({
...issueCommon,
body: readFileSync(
join(process.env.GITHUB_ACTION_PATH, "repro.md"),
"utf8"
),
body: readFileSync(join(__dirname, "repro.md"), "utf8"),
}),
])
return core.info(

View File

@@ -1,26 +1,74 @@
# https://github.com/actions/labeler#create-githublabeleryml
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/**/*"]
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/**
legacy:
- packages/next-auth/src/**/*
style:
- packages/next-auth/src/css/**/*
client:
- packages/next-auth/src/client/**/*
- packages/next-auth/src/react/**/*
pages:
- packages/next-auth/src/core/pages/**/*
TypeScript:
- packages/next-auth/src/**/types.ts
documentation:
- packages/docs/docs/**/*

25
.github/sync.yml vendored
View File

@@ -1,25 +0,0 @@
# Note that nextauthjs/next-auth-example syncs from the v4 branch
nextauthjs/sveltekit-auth-example:
- source: apps/examples/sveltekit
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE
# FIXME: Should re-enable, but currently fails:
# https://github.com/nextauthjs/next-auth/actions/runs/3811709391/jobs/6484533340
# (issue seems to be the name of the target repo)
# nextauthjs/solid-start-auth-example:
# - source: "apps/examples/solid-start"
# dest: .
# deleteOrphaned: true
# - .github/FUNDING.yml
# - LICENSE
nextauthjs/next-auth-gatsby-example:
- source: apps/playgrounds/gatsby
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE

View File

@@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: "Run issue validator"
run: node /home/runner/work/next-auth/next-auth/.github/actions/issue-validator/index.mjs
- name: 'Run issue validator'
run: node ./.github/actions/issue-validator/index.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -7,6 +7,7 @@ on:
- "beta"
- "next"
- "3.x"
- "v4"
pull_request:
jobs:
@@ -20,6 +21,8 @@ jobs:
fetch-depth: 2
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7.5.1
- name: Setup Node
uses: actions/setup-node@v3
with:
@@ -27,14 +30,18 @@ jobs:
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
- 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 }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
# - name: Coverage
# uses: codecov/codecov-action@v1
# with:
@@ -51,9 +58,10 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT_CLASSIC }}
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7.5.1
- name: Setup Node
uses: actions/setup-node@v3
with:
@@ -62,12 +70,15 @@ jobs:
- name: Install dependencies
run: pnpm install
- name: Publish to npm and GitHub
run: pnpm release
run: |
git config --global user.email "balazsorban44@users.noreply.github.com"
git config --global user.name "Balázs Orbán"
pnpm release
env:
# Use GH_PAT when this is fixed:
# https://github.com/github/roadmap/issues/622
GITHUB_TOKEN: ${{ secrets.GH_PAT_CLASSIC }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
NPM_TOKEN_PKG: ${{ secrets.NPM_TOKEN_PKG }}
NPM_TOKEN_ORG: ${{ secrets.NPM_TOKEN_ORG }}
release-pr:
name: Publish PR
runs-on: ubuntu-latest
@@ -79,6 +90,8 @@ jobs:
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 7.5.1
- name: Setup Node
uses: actions/setup-node@v3
with:
@@ -93,19 +106,19 @@ jobs:
PR_NUMBER: ${{ github.event.number }}
- name: Publish to npm
run: |
cd packages/core
cd packages/next-auth
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
pnpm publish --no-git-checks --access public --tag experimental
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PKG }}
- name: Comment version on PR
uses: NejcZdovc/comment-pr@v2
with:
message:
"🎉 Experimental release [published 📦️ on npm](https://npmjs.com/package/@auth/core/v/${{ env.VERSION }})!\n \
```sh\npnpm add @auth/core@${{ env.VERSION }}\n```\n \
```sh\nyarn add @auth/core@${{ env.VERSION }}\n```\n \
```sh\nnpm i @auth/core@${{ env.VERSION }}\n```"
"🎉 Experimental release [published 📦️ on npm](https://npmjs.com/package/next-auth/v/${{ env.VERSION }})!\n \
```sh\npnpm add next-auth@${{ env.VERSION }}\n```\n \
```sh\nyarn add next-auth@${{ env.VERSION }}\n```\n \
```sh\nnpm i next-auth@${{ env.VERSION }}\n```"
env:
VERSION: ${{ steps.determine-version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,19 +0,0 @@
name: Sync Example Repositories
on:
push:
branches:
- main
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run GitHub File Sync
# 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
with:
GH_PAT: ${{ secrets.GH_PAT_CLASSIC }}
SKIP_PR: true
ORIGINAL_MESSAGE: true

21
.gitignore vendored
View File

@@ -1,7 +1,7 @@
# Misc
.DS_Store
.npmrc
.eslintcache
.env
.env.local
.env.development.local
@@ -34,13 +34,9 @@ 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/*.d.ts*
packages/next-auth/*.js
packages/next-auth/next
packages/next-auth/middleware.d.ts
packages/next-auth/middleware.js
# Development app
apps/dev/src/css
@@ -51,7 +47,7 @@ apps/dev/typeorm
/.vs/slnx.sqlite-journal
/.vs/slnx.sqlite
/.vs
.vscode/generated*
.vscode
# Jetbrains
.idea
@@ -81,14 +77,11 @@ docs/.docusaurus
docs/providers.json
# Core
packages/core/*.js
packages/core/*.d.ts
packages/core/*.d.ts.map
packages/core/adapters.*
packages/core/index.*
packages/core/jwt
packages/core/lib
packages/core/providers
packages/core/src/lib/pages/styles.ts
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
# SvelteKit

1
.husky/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
_

4
.husky/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# npx pretty-quick --staged

View File

@@ -1,67 +0,0 @@
.cache-loader
.DS_Store
.pnpm-debug.log
.turbo
.vscode/generated*
/_work
/actions-runner
node_modules
patches
pnpm-lock.yaml
.github/actions/issue-validator/index.mjs
*.d.ts
*.d.ts.map
.svelte-kit
.next
.nuxt
# --------------- Docs ---------------
.docusaurus
build
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
static
docs/providers.json
# --------------- Packages ---------------
coverage
dist
packages/**/*.cjs
packages/**/*.js
# @auth/core
packages/core/src/providers/oauth-types.ts
packages/core/src/lib/pages/styles.ts
# @auth/sveltekit
packages/frameworks-sveltekit/package
packages/frameworks-sveltekit/vite.config.{js,ts}.timestamp-*
# next-auth
packages/next-auth/src/providers/oauth-types.ts
packages/next-auth/css/index.css
# Adapters
.branches
db.sqlite
dev.db
dynamodblocal-bin
firebase-debug.log
firestore-debug.log
migrations
test.schema.gql
# --------------- Apps ---------------
# Examples should have their own Prettier config since they are templates too
apps/example-sveltekit
# Development app
apps/dev/prisma
apps/dev/migrations
apps/dev/typeorm

View File

@@ -1,22 +0,0 @@
// @ts-check
/** @type {import("prettier").Config} */
module.exports = {
semi: false,
singleQuote: false,
overrides: [
{
files: [
"apps/dev/pages/api/auth/[...nextauth].ts",
"docs/{sidebars,docusaurus.config}.js",
],
options: { printWidth: 150 },
},
{
files: ["**/*package.json"],
options: {
trailingComma: "none",
},
},
],
}

View File

@@ -1,8 +0,0 @@
{
"files.exclude": {
"packages/core/{lib,providers,*.js,*.d.ts,*.d.ts.map}": true,
"packages/next-auth/{client,core,css,jwt,next,providers,react,utils,*.js,*.d.ts}": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"openInGitHub.remote.branch": "main"
}

View File

@@ -1,14 +0,0 @@
{
"oauth2-spec": {
"description": "Markdown link to OAuth 2 specification",
"scope": "typescript",
"prefix": "oauth2",
"body": ["[OAuth 2](https://datatracker.ietf.org/doc/html/rfc6749)"]
},
"oidc-spec": {
"description": "Markdown link to OpenID Connect specification",
"scope": "typescript",
"prefix": "oidc",
"body": ["[OIDC](https://openid.net/specs/openid-connect-core-1_0.html)"]
}
}

View File

@@ -1,6 +1,6 @@
ISC License
Copyright (c) 2022-2023, Balázs Orbán
Copyright (c) 2018-2021, Iain Collins
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -12,4 +12,4 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
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.
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

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/.github/blob/main/CONTRIBUTING.md#setting-up-local-environment)
](https://github.com/nextauthjs/next-auth/blob/main/CONTRIBUTING.md#setting-up-local-environment)

View File

@@ -0,0 +1,220 @@
import NextAuth, { type NextAuthOptions } from "next-auth"
// import { NextRequest } from "next/server"
// Providers
import Apple from "next-auth/providers/apple"
import Auth0 from "next-auth/providers/auth0"
import AzureAD from "next-auth/providers/azure-ad"
import AzureB2C from "next-auth/providers/azure-ad-b2c"
import BoxyHQSAML from "next-auth/providers/boxyhq-saml"
// import Cognito from "next-auth/providers/cognito"
import Credentials from "next-auth/providers/credentials"
import Discord from "next-auth/providers/discord"
import DuendeIDS6 from "next-auth/providers/duende-identity-server6"
// import Email from "next-auth/providers/email"
import Facebook from "next-auth/providers/facebook"
import Foursquare from "next-auth/providers/foursquare"
import Freshbooks from "next-auth/providers/freshbooks"
import GitHub from "next-auth/providers/github"
import Gitlab from "next-auth/providers/gitlab"
import Google from "next-auth/providers/google"
// import IDS4 from "next-auth/providers/identity-server4"
import Instagram from "next-auth/providers/instagram"
// import Keycloak from "next-auth/providers/keycloak"
import Line from "next-auth/providers/line"
import LinkedIn from "next-auth/providers/linkedin"
import Mailchimp from "next-auth/providers/mailchimp"
// import Okta from "next-auth/providers/okta"
import Osu from "next-auth/providers/osu"
import Patreon from "next-auth/providers/patreon"
import Slack from "next-auth/providers/slack"
import Spotify from "next-auth/providers/spotify"
import Trakt from "next-auth/providers/trakt"
import Twitch from "next-auth/providers/twitch"
import Twitter from "next-auth/providers/twitter"
import Vk from "next-auth/providers/vk"
import Wikimedia from "next-auth/providers/wikimedia"
import WorkOS from "next-auth/providers/workos"
// // Prisma
// import { PrismaClient } from "@prisma/client"
// import { PrismaAdapter } from "@next-auth/prisma-adapter"
// const client = globalThis.prisma || new PrismaClient()
// if (process.env.NODE_ENV !== "production") globalThis.prisma = client
// const adapter = PrismaAdapter(client)
// // Fauna
// import { Client as FaunaClient } from "faunadb"
// import { FaunaAdapter } from "@next-auth/fauna-adapter"
// const opts = { secret: process.env.FAUNA_SECRET, domain: process.env.FAUNA_DOMAIN }
// const client = globalThis.fauna || new FaunaClient(opts)
// if (process.env.NODE_ENV !== "production") globalThis.fauna = client
// const adapter = FaunaAdapter(client)
// // TypeORM
// import { TypeORMLegacyAdapter } from "@next-auth/typeorm-legacy-adapter"
// const adapter = TypeORMLegacyAdapter({
// type: "sqlite",
// name: "next-auth-test-memory",
// database: "./typeorm/dev.db",
// synchronize: true,
// })
// // Supabase
// import { SupabaseAdapter } from "@next-auth/supabase-adapter"
// const adapter = SupabaseAdapter({
// url: process.env.NEXT_PUBLIC_SUPABASE_URL,
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
// })
export const authOptions: NextAuthOptions = {
// adapter,
// debug: process.env.NODE_ENV !== "production",
theme: {
logo: "https://next-auth.js.org/img/logo/logo-sm.png",
brandColor: "#1786fb",
},
providers: [
Credentials({
credentials: { password: { label: "Password", type: "password" } },
async authorize(credentials) {
if (credentials.password !== "pw") return null
return {
name: "Fill Murray",
email: "bill@fillmurray.com",
image: "https://www.fillmurray.com/64/64",
id: "1",
foo: "",
}
},
}),
Apple({
clientId: process.env.APPLE_ID,
clientSecret: process.env.APPLE_SECRET,
}),
Auth0({
clientId: process.env.AUTH0_ID,
clientSecret: process.env.AUTH0_SECRET,
issuer: process.env.AUTH0_ISSUER,
}),
AzureAD({
clientId: process.env.AZURE_AD_CLIENT_ID,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET,
tenantId: process.env.AZURE_AD_TENANT_ID,
}),
AzureB2C({
clientId: process.env.AZURE_B2C_ID,
clientSecret: process.env.AZURE_B2C_SECRET,
issuer: process.env.AZURE_B2C_ISSUER,
}),
BoxyHQSAML({
issuer: "https://jackson-demo.boxyhq.com",
clientId: "tenant=boxyhq.com&product=saml-demo.boxyhq.com",
clientSecret: "dummy",
}),
// Cognito({ clientId: process.env.COGNITO_ID, clientSecret: process.env.COGNITO_SECRET, issuer: process.env.COGNITO_ISSUER }),
Discord({
clientId: process.env.DISCORD_ID,
clientSecret: process.env.DISCORD_SECRET,
}),
DuendeIDS6({
clientId: "interactive.confidential",
clientSecret: "secret",
issuer: "https://demo.duendesoftware.com",
}),
Facebook({
clientId: process.env.FACEBOOK_ID,
clientSecret: process.env.FACEBOOK_SECRET,
}),
Foursquare({
clientId: process.env.FOURSQUARE_ID,
clientSecret: process.env.FOURSQUARE_SECRET,
}),
Freshbooks({
clientId: process.env.FRESHBOOKS_ID,
clientSecret: process.env.FRESHBOOKS_SECRET,
}),
GitHub({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
Gitlab({
clientId: process.env.GITLAB_ID,
clientSecret: process.env.GITLAB_SECRET,
}),
Google({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
// IDS4({ clientId: process.env.IDS4_ID, clientSecret: process.env.IDS4_SECRET, issuer: process.env.IDS4_ISSUER }),
Instagram({
clientId: process.env.INSTAGRAM_ID,
clientSecret: process.env.INSTAGRAM_SECRET,
}),
// Keycloak({ clientId: process.env.KEYCLOAK_ID, clientSecret: process.env.KEYCLOAK_SECRET, issuer: process.env.KEYCLOAK_ISSUER }),
Line({
clientId: process.env.LINE_ID,
clientSecret: process.env.LINE_SECRET,
}),
LinkedIn({
clientId: process.env.LINKEDIN_ID,
clientSecret: process.env.LINKEDIN_SECRET,
}),
Mailchimp({
clientId: process.env.MAILCHIMP_ID,
clientSecret: process.env.MAILCHIMP_SECRET,
}),
// Okta({ clientId: process.env.OKTA_ID, clientSecret: process.env.OKTA_SECRET, issuer: process.env.OKTA_ISSUER }),
Osu({
clientId: process.env.OSU_CLIENT_ID,
clientSecret: process.env.OSU_CLIENT_SECRET,
}),
Patreon({
clientId: process.env.PATREON_ID,
clientSecret: process.env.PATREON_SECRET,
}),
Slack({
clientId: process.env.SLACK_ID,
clientSecret: process.env.SLACK_SECRET,
}),
Spotify({
clientId: process.env.SPOTIFY_ID,
clientSecret: process.env.SPOTIFY_SECRET,
}),
Trakt({
clientId: process.env.TRAKT_ID,
clientSecret: process.env.TRAKT_SECRET,
}),
Twitch({
clientId: process.env.TWITCH_ID,
clientSecret: process.env.TWITCH_SECRET,
}),
Twitter({
clientId: process.env.TWITTER_ID,
clientSecret: process.env.TWITTER_SECRET,
}),
// TwitterLegacy({ clientId: process.env.TWITTER_LEGACY_ID, clientSecret: process.env.TWITTER_LEGACY_SECRET }),
Vk({ clientId: process.env.VK_ID, clientSecret: process.env.VK_SECRET }),
Wikimedia({
clientId: process.env.WIKIMEDIA_ID,
clientSecret: process.env.WIKIMEDIA_SECRET,
}),
WorkOS({
clientId: process.env.WORKOS_ID,
clientSecret: process.env.WORKOS_SECRET,
}),
],
}
/**
* Advanced Initialization - route handler
*/
// const handler = async (
// req: NextRequest,
// routeContext: { params: { nextauth: string[] } }
// ): Promise<any> => {
// return NextAuth(req, routeContext, authOptions)
// }
const handler = NextAuth(authOptions)
export { handler as GET, handler as POST }

View File

@@ -0,0 +1,6 @@
import { getServerSession } from "next-auth/next"
export default async function Page() {
const session = await getServerSession()
return <pre>{JSON.stringify(session, null, 2)}</pre>
}

View File

@@ -8,10 +8,10 @@ export default function Footer() {
<hr />
<ul className={styles.navItems}>
<li className={styles.navItem}>
<a href="https://authjs.dev">Documentation</a>
<a href="https://next-auth.js.org">Documentation</a>
</li>
<li className={styles.navItem}>
<a href="https://www.npmjs.com/package/@auth/core">NPM</a>
<a href="https://www.npmjs.com/package/next-auth">NPM</a>
</li>
<li className={styles.navItem}>
<a href="https://github.com/nextauthjs/next-auth-example">GitHub</a>

View File

@@ -11,4 +11,4 @@
.navItem {
display: inline-block;
margin-right: 1rem;
}
}

View File

@@ -11,10 +11,10 @@
top: 0;
opacity: 1;
overflow: hidden;
border-radius: 0 0 0.6rem 0.6rem;
padding: 0.6rem 1rem;
border-radius: 0 0 .6rem .6rem;
padding: .6rem 1rem;
margin: 0;
background-color: rgba(0, 0, 0, 0.05);
background-color: rgba(0,0,0,.05);
transition: all 0.2s ease-in;
}
@@ -26,13 +26,13 @@
.signedInText,
.notSignedInText {
position: absolute;
padding-top: 0.8rem;
padding-top: .8rem;
left: 1rem;
right: 6.5rem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inherit;
display: inherit;
z-index: 1;
line-height: 1.3rem;
}
@@ -55,13 +55,13 @@
.button,
.buttonPrimary {
float: right;
margin-right: -0.4rem;
margin-right: -.4rem;
font-weight: 500;
border-radius: 0.3rem;
border-radius: .3rem;
cursor: pointer;
font-size: 1rem;
line-height: 1.4rem;
padding: 0.7rem 0.8rem;
padding: .7rem .8rem;
position: relative;
z-index: 10;
background-color: transparent;
@@ -73,11 +73,11 @@
border-color: #346df1;
color: #fff;
text-decoration: none;
padding: 0.7rem 1.4rem;
padding: .7rem 1.4rem;
}
.buttonPrimary:hover {
box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.2);
box-shadow: inset 0 0 5rem rgba(0,0,0,0.2)
}
.navItems {
@@ -89,4 +89,4 @@
.navItem {
display: inline-block;
margin-right: 1rem;
}
}

View File

@@ -0,0 +1,14 @@
import Header from 'components/header'
import Footer from 'components/footer'
export default function Layout ({ children }) {
return (
<>
<Header />
<main>
{children}
</main>
<Footer />
</>
)
}

6
apps/dev/next-env.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View File

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

View File

@@ -1,6 +0,0 @@
import { unstable_getServerSession } from "next-auth/next"
export default async function Page() {
const session = await unstable_getServerSession()
return <pre>{JSON.stringify(session, null, 2)}</pre>
}

View File

@@ -1,12 +0,0 @@
import Header from "components/header"
import Footer from "components/footer"
export default function Layout({ children }) {
return (
<>
<Header />
<main>{children}</main>
<Footer />
</>
)
}

View File

@@ -1,27 +0,0 @@
import Layout from "../components/layout"
export default function Page() {
return (
<Layout>
<h1>Client Side Rendering</h1>
<p>
This page uses the <strong>useSession()</strong> React Hook in the{" "}
<strong>&lt;/Header&gt;</strong> component.
</p>
<p>
The <strong>useSession()</strong> React Hook easy to use and allows
pages to render very quickly.
</p>
<p>
The advantage of this approach is that session state is shared between
pages by using the <strong>Provider</strong> in <strong>_app.js</strong>{" "}
so that navigation between pages using <strong>useSession()</strong> is
very fast.
</p>
<p>
The disadvantage of <strong>useSession()</strong> is that it requires
client side JavaScript.
</p>
</Layout>
)
}

View File

@@ -1,13 +0,0 @@
import Layout from "components/layout"
export default function Page() {
return (
<Layout>
<h1>NextAuth.js Example</h1>
<p>
This is an example site to demonstrate how to use{" "}
<a href="https://authjs.dev">NextAuth.js</a> for authentication.
</p>
</Layout>
)
}

View File

@@ -1,32 +0,0 @@
import Layout from "../components/layout"
export default function Page() {
return (
<Layout>
<p>
This is an example site to demonstrate how to use{" "}
<a href="https://authjs.dev">Auth.js</a> for authentication.
</p>
<h2>Terms of Service</h2>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
<h2>Privacy Policy</h2>
<p>
This site uses JSON Web Tokens and an in-memory database which resets
every ~2 hours.
</p>
<p>
Data provided to this site is exclusively used to support signing in and
is not passed to any third party services, other than via SMTP or OAuth
for the purposes of authentication.
</p>
</Layout>
)
}

View File

@@ -1,11 +1,12 @@
{
"name": "next-auth-app",
"version": "1.0.0",
"description": "Next.js + Auth.js Developer app",
"description": "NextAuth.js Developer app",
"private": true,
"scripts": {
"clean": "rm -rf .next",
"dev": "next dev",
"lint": "next lint",
"build": "next build",
"start": "next start",
"email": "fake-smtp-server",
@@ -20,16 +21,15 @@
"@prisma/client": "^3",
"@supabase/supabase-js": "^2.0.5",
"faunadb": "^4",
"next": "13.1.1",
"next": "13.4.12",
"next-auth": "workspace:*",
"@auth/core": "workspace:*",
"nodemailer": "^6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.5",
"@types/react": "^18.0.15",
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.6",
"fake-smtp-server": "^0.8.0",
"pg": "^8.7.3",

View File

@@ -1,19 +1,17 @@
import Layout from "../components/layout"
import Layout from '../components/layout'
export default function Page() {
export default function Page () {
return (
<Layout>
<h1>API Example</h1>
<p>The examples below show responses from the example API endpoints.</p>
<p>
<em>You must be signed in to see responses.</em>
</p>
<p><em>You must be signed in to see responses.</em></p>
<h2>Session</h2>
<p>/api/examples/session</p>
<iframe src="/api/examples/session" />
<iframe src='/api/examples/session' />
<h2>JSON Web Token</h2>
<p>/api/examples/jwt</p>
<iframe src="/api/examples/jwt" />
<iframe src='/api/examples/jwt' />
</Layout>
)
}

View File

@@ -1,39 +1,39 @@
import { Auth, type AuthConfig } from "@auth/core"
import NextAuth, { NextAuthOptions } from "next-auth"
// Providers
import Apple from "@auth/core/providers/apple"
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 BoxyHQSAML from "@auth/core/providers/boxyhq-saml"
// import Cognito from "@auth/core/providers/cognito"
import Credentials from "@auth/core/providers/credentials"
import Discord from "@auth/core/providers/discord"
import DuendeIDS6 from "@auth/core/providers/duende-identity-server6"
// import Email from "@auth/core/providers/email"
import Facebook from "@auth/core/providers/facebook"
import Foursquare from "@auth/core/providers/foursquare"
import Freshbooks from "@auth/core/providers/freshbooks"
import GitHub from "@auth/core/providers/github"
import Gitlab from "@auth/core/providers/gitlab"
import Google from "@auth/core/providers/google"
// import IDS4 from "@auth/core/providers/identity-server4"
import Instagram from "@auth/core/providers/instagram"
// import Keycloak from "@auth/core/providers/keycloak"
import Line from "@auth/core/providers/line"
import LinkedIn from "@auth/core/providers/linkedin"
import Mailchimp from "@auth/core/providers/mailchimp"
// import Okta from "@auth/core/providers/okta"
import Osu from "@auth/core/providers/osu"
import Patreon from "@auth/core/providers/patreon"
import Slack from "@auth/core/providers/slack"
import Spotify from "@auth/core/providers/spotify"
import Trakt from "@auth/core/providers/trakt"
import Twitch from "@auth/core/providers/twitch"
import Twitter from "@auth/core/providers/twitter"
import Vk from "@auth/core/providers/vk"
import Wikimedia from "@auth/core/providers/wikimedia"
import WorkOS from "@auth/core/providers/workos"
import Apple from "next-auth/providers/apple"
import Auth0 from "next-auth/providers/auth0"
import AzureAD from "next-auth/providers/azure-ad"
import AzureB2C from "next-auth/providers/azure-ad-b2c"
import BoxyHQSAML from "next-auth/providers/boxyhq-saml"
// import Cognito from "next-auth/providers/cognito"
import Credentials from "next-auth/providers/credentials"
import Discord from "next-auth/providers/discord"
import DuendeIDS6 from "next-auth/providers/duende-identity-server6"
// import Email from "next-auth/providers/email"
import Facebook from "next-auth/providers/facebook"
import Foursquare from "next-auth/providers/foursquare"
import Freshbooks from "next-auth/providers/freshbooks"
import GitHub from "next-auth/providers/github"
import Gitlab from "next-auth/providers/gitlab"
import Google from "next-auth/providers/google"
// import IDS4 from "next-auth/providers/identity-server4"
import Instagram from "next-auth/providers/instagram"
// import Keycloak from "next-auth/providers/keycloak"
import Line from "next-auth/providers/line"
import LinkedIn from "next-auth/providers/linkedin"
import Mailchimp from "next-auth/providers/mailchimp"
// import Okta from "next-auth/providers/okta"
import Osu from "next-auth/providers/osu"
import Patreon from "next-auth/providers/patreon"
import Slack from "next-auth/providers/slack"
import Spotify from "next-auth/providers/spotify"
import Trakt from "next-auth/providers/trakt"
import Twitch from "next-auth/providers/twitch"
import Twitter from "next-auth/providers/twitter"
import Vk from "next-auth/providers/vk"
import Wikimedia from "next-auth/providers/wikimedia"
import WorkOS from "next-auth/providers/workos"
// // Prisma
// import { PrismaClient } from "@prisma/client"
@@ -66,7 +66,7 @@ import WorkOS from "@auth/core/providers/workos"
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
// })
export const authConfig: AuthConfig = {
export const authOptions: NextAuthOptions = {
// adapter,
// debug: process.env.NODE_ENV !== "production",
theme: {
@@ -118,10 +118,9 @@ export const authConfig: AuthConfig = {
Wikimedia({ clientId: process.env.WIKIMEDIA_ID, clientSecret: process.env.WIKIMEDIA_SECRET }),
WorkOS({ clientId: process.env.WORKOS_ID, clientSecret: process.env.WORKOS_SECRET }),
],
// debug: process.env.NODE_ENV !== "production",
}
if (authConfig.adapter) {
if (authOptions.adapter) {
// TODO:
// authOptions.providers.unshift(
// // NOTE: You can start a fake e-mail server with `pnpm email`
@@ -130,22 +129,4 @@ if (authConfig.adapter) {
// )
}
// TODO: move to next-auth/edge
function AuthHandler(...args: any[]) {
const envSecret = process.env.AUTH_SECRET ?? process.env.NEXTAUTH_SECRET
const envTrustHost = !!(process.env.NEXTAUTH_URL ?? process.env.AUTH_TRUST_HOST ?? process.env.VERCEL ?? process.env.NODE_ENV !== "production")
if (args.length === 1) {
return async (req: Request) => {
args[0].secret ??= envSecret
args[0].trustHost ??= envTrustHost
return Auth(req, args[0])
}
}
args[1].secret ??= envSecret
args[1].trustHost ??= envTrustHost
return Auth(args[0], args[1])
}
export default AuthHandler(authConfig)
export const config = { runtime: "experimental-edge" }
export default NextAuth(authOptions)

View File

@@ -1,9 +1,9 @@
// This is an example of to protect an API route
import { unstable_getServerSession } from "next-auth/next"
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
export default async (req, res) => {
const session = await unstable_getServerSession(req, res, authOptions)
const session = await getServerSession(req, res, authOptions)
if (session) {
res.send({

View File

@@ -1,8 +1,8 @@
// This is an example of how to access a session from an API route
import { unstable_getServerSession } from "next-auth/next"
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
export default async (req, res) => {
const session = await unstable_getServerSession(req, res, authOptions)
const session = await getServerSession(req, res, authOptions)
res.json(session)
}

View File

@@ -1,11 +1,11 @@
// This is an example of how to query data from Supabase with RLS.
// Learn more about Row Levele Security (RLS): https://supabase.com/docs/guides/auth/row-level-security
import { unstable_getServerSession } from "next-auth/next"
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
import { createClient } from "@supabase/supabase-js"
export default async (req, res) => {
const session = await unstable_getServerSession(req, res, authOptions)
const session = await getServerSession(req, res, authOptions)
if (!session)
return res.send(JSON.stringify({ error: "No session!" }, null, 2))

22
apps/dev/pages/client.js Normal file
View File

@@ -0,0 +1,22 @@
import Layout from '../components/layout'
export default function Page () {
return (
<Layout>
<h1>Client Side Rendering</h1>
<p>
This page uses the <strong>useSession()</strong> React Hook in the <strong>&lt;/Header&gt;</strong> component.
</p>
<p>
The <strong>useSession()</strong> React Hook easy to use and allows pages to render very quickly.
</p>
<p>
The advantage of this approach is that session state is shared between pages by using the <strong>Provider</strong> in <strong>_app.js</strong> so
that navigation between pages using <strong>useSession()</strong> is very fast.
</p>
<p>
The disadvantage of <strong>useSession()</strong> is that it requires client side JavaScript.
</p>
</Layout>
)
}

12
apps/dev/pages/index.js Normal file
View File

@@ -0,0 +1,12 @@
import Layout from 'components/layout'
export default function Page () {
return (
<Layout>
<h1>NextAuth.js Example</h1>
<p>
This is an example site to demonstrate how to use <a href='https://next-auth.js.org'>NextAuth.js</a> for authentication.
</p>
</Layout>
)
}

30
apps/dev/pages/policy.js Normal file
View File

@@ -0,0 +1,30 @@
import Layout from '../components/layout'
export default function Page () {
return (
<Layout>
<p>
This is an example site to demonstrate how to use <a href='https://next-auth.js.org'>NextAuth.js</a> for authentication.
</p>
<h2>Terms of Service</h2>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</p>
<h2>Privacy Policy</h2>
<p>
This site uses JSON Web Tokens and an in-memory database which resets every ~2 hours.
</p>
<p>
Data provided to this site is exclusively used to support signing in
and is not passed to any third party services, other than via SMTP or OAuth for the
purposes of authentication.
</p>
</Layout>
)
}

View File

@@ -1,5 +1,5 @@
// This is an example of how to protect content using server rendering
import { unstable_getServerSession } from "next-auth/next"
import { getServerSession } from "next-auth/next"
import { authOptions } from "./api/auth/[...nextauth]"
import Layout from "../components/layout"
import AccessDenied from "../components/access-denied"
@@ -26,11 +26,7 @@ export default function Page({ content, session }) {
}
export async function getServerSideProps(context) {
const session = await unstable_getServerSession(
context.req,
context.res,
authOptions
)
const session = await getServerSession(context.req, context.res, authOptions)
let content = null
if (session) {

View File

@@ -1,4 +1,4 @@
import { unstable_getServerSession } from "next-auth/next"
import { getServerSession } from "next-auth/next"
import Layout from "../components/layout"
import { authOptions } from "./api/auth/[...nextauth]"
@@ -12,11 +12,11 @@ export default function Page() {
<Layout>
<h1>Server Side Rendering</h1>
<p>
This page uses the <strong>unstable_getServerSession()</strong> method
in <strong>getServerSideProps()</strong>.
This page uses the <strong>getServerSession()</strong> method in{" "}
<strong>getServerSideProps()</strong>.
</p>
<p>
Using <strong>unstable_getServerSession()</strong> in{" "}
Using <strong>getServerSession()</strong> in{" "}
<strong>getServerSideProps()</strong> is currently the recommended
approach, although the API may still change, if you need to support
Server Side Rendering with authentication.
@@ -40,11 +40,7 @@ export default function Page() {
export async function getServerSideProps(context) {
return {
props: {
session: await unstable_getServerSession(
context.req,
context.res,
authOptions
),
session: await getServerSession(context.req, context.res, authOptions),
},
}
}

View File

@@ -27,6 +27,6 @@ iframe {
border: 1px solid #ccc;
height: 10rem;
width: 100%;
border-radius: 0.5rem;
border-radius: .5rem;
filter: invert(1);
}
}

View File

@@ -9,6 +9,7 @@ export default function Page() {
useEffect(() => {
if (session) {
console.log(session)
// User is logged in, let's fetch their data.
const { supabaseAccessToken } = session
const supabase = createClient(

View File

@@ -1,6 +1,6 @@
// This is an example of how to protect content using server rendering
// and fetching data from Supabase with RLS enabled.
import { unstable_getServerSession } from "next-auth/next"
import { getServerSession } from "next-auth/next"
import { authOptions } from "./api/auth/[...nextauth]"
import { createClient } from "@supabase/supabase-js"
import Layout from "../components/layout"
@@ -27,11 +27,7 @@ export default function Page({ data, session }) {
}
export async function getServerSideProps(context) {
const session = await unstable_getServerSession(
context.req,
context.res,
authOptions
)
const session = await getServerSession(context.req, context.res, authOptions)
if (!session)
return {

View File

@@ -1,5 +0,0 @@
GITHUB_ID=
GITHUB_SECRET=
# On UNIX systems you can use `openssl rand -hex 32` or
# https://generate-secret.vercel.app/32 to generate a secret.
AUTH_SECRET=

View File

@@ -1,13 +0,0 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

View File

@@ -1,20 +0,0 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};

View File

@@ -1,12 +0,0 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
.vercel
.output
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

View File

@@ -1,13 +0,0 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

View File

@@ -1,6 +0,0 @@
{
"semi": false,
"plugins": ["prettier-plugin-svelte"],
"pluginSearchDirs": ["."],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}

View File

@@ -1,28 +0,0 @@
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/example-sveltekit). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
<p align="center">
<br/>
<a href="https://authjs.dev" target="_blank"><img width="150px" src="https://authjs.dev/img/logo/logo-sm.png" /></a>
<h3 align="center">Auth.js Example App with <a href="https://kit.svelte.dev">SvelteKit</a></h3>
<p align="center">
Open Source. Full Stack. Own Your Data.
</p>
<p align="center" style="align: center;">
<a href="https://npm.im/@auth/sveltekit">
<img alt="npm" src="https://img.shields.io/npm/v/@auth/sveltekit?color=green&label=@auth/sveltekit&style=flat-square">
</a>
<a href="https://bundlephobia.com/result?p=sveltekit-auth-example">
<img src="https://img.shields.io/bundlephobia/minzip/@auth/sveltekit?label=size&style=flat-square" alt="Bundle Size"/>
</a>
<a href="https://www.npmtrends.com/@auth/sveltekit">
<img src="https://img.shields.io/npm/dm/@auth/sveltekit?label=%20downloads&style=flat-square" alt="Downloads" />
</a>
<a href="https://npm.im/next-auth">
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
</a>
</p>
</p>
# Documentation
- [sveltekit.authjs.dev](https://sveltekit.authjs.dev)

View File

@@ -1,26 +0,0 @@
{
"name": "sveltekit-auth-app",
"version": "1.0.0",
"description": "SvelteKit + Auth.js Developer app",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "next",
"svelte": "3.55.0",
"svelte-check": "2.10.2",
"typescript": "4.9.4",
"vite": "4.0.1"
},
"dependencies": {
"@auth/core": "latest",
"@auth/sveltekit": "latest"
},
"type": "module"
}

View File

@@ -1 +0,0 @@
/// <reference types="@auth/sveltekit" />

View File

@@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<meta name="viewport" content="width=device-width" />
%sveltekit.head%
</head>
<body>
<div>%sveltekit.body%</div>
</body>
</html>

View File

@@ -1,7 +0,0 @@
import { SvelteKitAuth } from "@auth/sveltekit"
import GitHub from "@auth/core/providers/github"
import { GITHUB_ID, GITHUB_SECRET } from "$env/static/private"
export const handle = SvelteKitAuth({
providers: [GitHub({ clientId: GITHUB_ID, clientSecret: GITHUB_SECRET })],
})

View File

@@ -1,12 +0,0 @@
<script lang="ts">
export let provider: any
</script>
<form action={provider.signinUrl} method="POST">
{#if provider.callbackUrl}
<input type="hidden" name="callbackUrl" value={provider.callbackUrl} />
{/if}
<button type="submit" class="button">
<slot>Sign in with {provider.name}</slot>
</button>
</form>

View File

@@ -1,7 +0,0 @@
import type { LayoutServerLoad } from "./$types"
export const load: LayoutServerLoad = async (event) => {
return {
session: await event.locals.getSession(),
}
}

View File

@@ -1,151 +0,0 @@
<script lang="ts">
import { page } from "$app/stores"
</script>
<div>
<header>
<div class="signedInStatus">
<p class="nojs-show loaded">
{#if $page.data.session}
{#if $page.data.session.user?.image}
<span
style="background-image: url('{$page.data.session.user.image}')"
class="avatar"
/>
{/if}
<span class="signedInText">
<small>Signed in as</small><br />
<strong
>{$page.data.session.user?.email ??
$page.data.session.user?.name}</strong
>
</span>
<a href="/auth/signout" class="button">Sign out</a>
{:else}
<span class="notSignedInText">You are not signed in</span>
<a href="/auth/signin" class="buttonPrimary">Sign in</a>
{/if}
</p>
</div>
<nav>
<ul class="navItems">
<li class="navItem"><a href="/">Home</a></li>
<li class="navItem"><a href="/protected">Protected</a></li>
</ul>
</nav>
</header>
<slot />
</div>
<style>
:global(body) {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
padding: 0 1rem 1rem 1rem;
max-width: 680px;
margin: 0 auto;
background: #fff;
color: #333;
}
:global(li),
:global(p) {
line-height: 1.5rem;
}
:global(a) {
font-weight: 500;
}
:global(hr) {
border: 1px solid #ddd;
}
:global(iframe) {
background: #ccc;
border: 1px solid #ccc;
height: 10rem;
width: 100%;
border-radius: 0.5rem;
filter: invert(1);
}
.nojs-show {
opacity: 1;
top: 0;
}
.signedInStatus {
display: block;
min-height: 4rem;
width: 100%;
}
.loaded {
position: relative;
top: 0;
opacity: 1;
overflow: hidden;
border-radius: 0 0 0.6rem 0.6rem;
padding: 0.6rem 1rem;
margin: 0;
background-color: rgba(0, 0, 0, 0.05);
transition: all 0.2s ease-in;
}
.signedInText,
.notSignedInText {
position: absolute;
padding-top: 0.8rem;
left: 1rem;
right: 6.5rem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inherit;
z-index: 1;
line-height: 1.3rem;
}
.signedInText {
padding-top: 0rem;
left: 4.6rem;
}
.avatar {
border-radius: 2rem;
float: left;
height: 2.8rem;
width: 2.8rem;
background-color: white;
background-size: cover;
background-repeat: no-repeat;
}
.button,
.buttonPrimary {
float: right;
margin-right: -0.4rem;
font-weight: 500;
border-radius: 0.3rem;
cursor: pointer;
font-size: 1rem;
line-height: 1.4rem;
padding: 0.7rem 0.8rem;
position: relative;
z-index: 10;
background-color: transparent;
color: #555;
}
.buttonPrimary {
background-color: #346df1;
border-color: #346df1;
color: #fff;
text-decoration: none;
padding: 0.7rem 1.4rem;
}
.buttonPrimary:hover {
box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.2);
}
.navItems {
margin-bottom: 2rem;
padding: 0;
list-style: none;
}
.navItem {
display: inline-block;
margin-right: 1rem;
}
</style>

View File

@@ -1,7 +0,0 @@
<h1>SvelteKit Auth Example</h1>
<p>
This is an example site to demonstrate how to use <a
href="https://kit.svelte.dev/">SvelteKit</a
>
with <a href="https://sveltekit.authjs.dev">SvelteKit Auth</a> for authentication.
</p>

View File

@@ -1,19 +0,0 @@
<script lang="ts">
import { page } from "$app/stores"
</script>
{#if $page.data.session}
<h1>Protected page</h1>
<p>
This is a protected content. You can access this content because you are
signed in.
</p>
<p>Session expiry: {$page.data.session?.expires}</p>
{:else}
<h1>Access Denied</h1>
<p>
<a href="/auth/signin">
You must be signed in to view this page
</a>
</p>
{/if}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,15 +0,0 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
adapter: adapter()
}
};
export default config;

View File

@@ -1,17 +0,0 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}

View File

@@ -1,8 +0,0 @@
import { sveltekit } from "@sveltejs/kit/vite"
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit()],
}
export default config

View File

@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "esnext",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
@@ -19,8 +23,17 @@
{
"name": "next"
}
]
],
"strictNullChecks": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", "jest.config.js"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules",
"jest.config.js"
]
}

View File

@@ -0,0 +1,110 @@
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/example-gatsby). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).
<p align="center">
<br/>
<a href="https://next-auth.js.org" target="_blank"><img width="150px" src="https://next-auth.js.org/img/logo/logo-sm.png" /></a>
<h3 align="center">NextAuth.js Example App</h3>
<p align="center">
Open Source. Full Stack. Own Your Data.
</p>
<p align="center" style="align: center;">
<a href="https://npm.im/next-auth">
<img alt="npm" src="https://img.shields.io/npm/v/next-auth?color=green&label=next-auth">
</a>
<a href="https://bundlephobia.com/result?p=next-auth-example">
<img src="https://img.shields.io/bundlephobia/minzip/next-auth?label=next-auth" alt="Bundle Size"/>
</a>
<a href="https://www.npmtrends.com/next-auth">
<img src="https://img.shields.io/npm/dm/next-auth?label=next-auth%20downloads" alt="Downloads" />
</a>
</p>
</p>
## Overview
NextAuth.js is a complete open source authentication solution.
This is an example application that shows how `next-auth` is applied to a basic Gatsby app. We are showing how to configure the backend both as a [Vercel Function](https://vercel.com/docs/concepts/functions/introduction) for deployment to Vercel, and also for [Gatsby Functions](https://www.gatsbyjs.com/docs/reference/functions) for other platforms.
The deployed version can be found at [`next-auth-gatsby-example.vercel.app`](https://next-auth-gatsby-example.vercel.app)
### About NextAuth.js
NextAuth.js is an easy to implement, full-stack (client/server) open source authentication library originally designed for [Next.js](https://nextjs.org) and [Serverless](https://vercel.com), but this example shows how to use it in a Gatsby project. Our goal is to [support even more frameworks](https://github.com/nextauthjs/next-auth/issues/2294) in the future.
Go to [next-auth.js.org](https://next-auth.js.org) for more information and documentation.
> *NextAuth.js is not officially associated with Vercel or Next.js.*
## Getting Started
### 1. Clone the repository and install dependencies
```
git clone https://github.com/nextauthjs/next-auth-gatsby-example.git
cd next-auth-gatsby-example
npm install
```
### 2. Configure your local environment
Copy the .env.local.example file in this directory to .env.local (which will be ignored by Git):
```
cp .env.local.example .env.local
```
Add details for one or more providers (e.g. Google, Twitter, GitHub, Email, etc).
#### Database
A database is needed to persist user accounts and to support email sign in. However, you can still use NextAuth.js for authentication without a database by using OAuth for authentication. If you do not specify a database, [JSON Web Tokens](https://jwt.io/introduction) will be enabled by default.
You **can** skip configuring a database and come back to it later if you want.
For more information about setting up a database, please check out the following links:
* Docs: [next-auth.js.org/adapters/overview](https://next-auth.js.org/adapters/overview)
### 3. Configure Authentication Providers
1. Review and update options in `nextauth.config.js` as needed.
2. When setting up OAuth, in the developer admin page for each of your OAuth services, you should configure the callback URL to use a callback path of `{server}/api/auth/callback/{provider}`.
e.g. For Google OAuth you would use: `http://localhost:3000/api/auth/callback/google`
A list of configured providers and their callback URLs is available from the endpoint `/api/auth/providers`. You can find more information at https://next-auth.js.org/configuration/providers/oauth
3. You can also choose to specify an SMTP server for passwordless sign in via email.
### 4. Start the application
To run your site locally, use:
```
npm run dev
```
To run it in production mode, use:
```
npm run build
npm run start
```
### 5. Preparing for Production
Follow the [Deployment documentation](https://next-auth.js.org/deployment)
## Acknowledgements
<a href="https://vercel.com?utm_source=nextauthjs&utm_campaign=oss">
<img width="170px" src="https://raw.githubusercontent.com/nextauthjs/next-auth/canary/www/static/img/powered-by-vercel.svg" alt="Powered By Vercel" />
</a>
<p align="left">Thanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire NextAuth.js Team</p>
## License
ISC

View File

@@ -1,5 +1,5 @@
// Gatsby Functions are not yet supported on Vercel, so you'll need to use the root `api` folder.
import NextAuth from "next-auth"
import NextAuth from "next-auth/next"
import { authConfig } from "../../nextauth.config"
export default async function handler(req, res) {

View File

@@ -1,6 +1,6 @@
// If your deployment environment supports Gatsby Functions, you won't need the root `api` folder, only this.
import NextAuth from "next-auth"
import NextAuth from "next-auth/next"
import { authConfig } from "../../nextauth.config"
export default async function handler(req, res) {

View File

@@ -11,7 +11,8 @@ export default function Home() {
<h1>NextAuth.js Example</h1>
<p>
An example site to demonstrate how to use{" "}
<a href="https://authjs.dev">Auth.js</a> for authentication in Gatsby.
<a href="https://next-auth.js.org">NextAuth.js</a> for authentication in
Gatsby.
</p>
{
{

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -9,16 +9,16 @@
</p>
<p align="center" style="align: center;">
<a href="https://npm.im/next-auth">
<img alt="npm" src="https://img.shields.io/npm/v/next-auth?color=green&label=next-auth&style=flat-square">
<img alt="npm" src="https://img.shields.io/npm/v/next-auth?color=green&label=next-auth">
</a>
<a href="https://bundlephobia.com/result?p=next-auth-example">
<img src="https://img.shields.io/bundlephobia/minzip/next-auth?label=size&style=flat-square" alt="Bundle Size"/>
<img src="https://img.shields.io/bundlephobia/minzip/next-auth?label=next-auth" alt="Bundle Size"/>
</a>
<a href="https://www.npmtrends.com/next-auth">
<img src="https://img.shields.io/npm/dm/next-auth?label=downloads&style=flat-square" alt="Downloads" />
<img src="https://img.shields.io/npm/dm/next-auth?label=next-auth%20downloads" alt="Downloads" />
</a>
<a href="https://npm.im/next-auth">
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
<img src="https://img.shields.io/badge/npm-TypeScript-blue" alt="TypeScript" />
</a>
</p>
</p>
@@ -37,7 +37,7 @@ NextAuth.js is an easy to implement, full-stack (client/server) open source auth
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._
> *NextAuth.js is not officially associated with Vercel or Next.js.*
## Getting Started
@@ -67,7 +67,7 @@ You **can** skip configuring a database and come back to it later if you want.
For more information about setting up a database, please check out the following links:
- Docs: [next-auth.js.org/adapters/overview](https://next-auth.js.org/adapters/overview)
* Docs: [next-auth.js.org/adapters/overview](https://next-auth.js.org/adapters/overview)
### 3. Configure Authentication Providers
@@ -75,9 +75,9 @@ For more information about setting up a database, please check out the following
2. When setting up OAuth, in the developer admin page for each of your OAuth services, you should configure the callback URL to use a callback path of `{server}/api/auth/callback/{provider}`.
e.g. For Google OAuth you would use: `http://localhost:3000/api/auth/callback/google`
e.g. For Google OAuth you would use: `http://localhost:3000/api/auth/callback/google`
A list of configured providers and their callback URLs is available from the endpoint `/api/auth/providers`. You can find more information at https://next-auth.js.org/configuration/providers/oauth
A list of configured providers and their callback URLs is available from the endpoint `/api/auth/providers`. You can find more information at https://next-auth.js.org/configuration/providers/oauth
3. You can also choose to specify an SMTP server for passwordless sign in via email.
@@ -110,3 +110,4 @@ Follow the [Deployment documentation](https://next-auth.js.org/deployment)
## License
ISC

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