Compare commits

...

497 Commits

Author SHA1 Message Date
GitHub Actions
8f8067a23a chore(release): bump package version(s) [skip ci] 2023-09-28 10:52:10 +00:00
Balázs Orbán
8629e16255 fix: allow csrfDisabled on session action 2023-09-28 12:48:04 +02:00
Balázs Orbán
bfa0d910d7 chore: disable build of next-auth on main
it's released from the `v4` branch right now
2023-09-28 12:21:50 +02:00
Balázs Orbán
cff0d61e07 chore: format turbo.json 2023-09-28 01:45:58 +02:00
Balázs Orbán
41c24542b5 chore: drop duplicate provider-logos 2023-09-28 01:21:50 +02:00
Balázs Orbán
77a439b2a2 chore: docs fix config 2023-09-28 01:10:49 +02:00
Balázs Orbán
95eb8aaf69 docs: pull out docs changes from #7443
to minimize the diff there
2023-09-28 01:08:06 +02:00
Balázs Orbán
559842fe02 chore: remove v4 dev app 2023-09-28 00:51:04 +02:00
Balázs Orbán
ce7a49910e chore(examples): add cognito issuer 2023-09-27 13:41:35 +02:00
Balázs Orbán
e895f42302 docs: fix edit links for adapters 2023-09-26 12:39:29 +02:00
panstabolitis
db2ace585d fix(docs): correct comment syntax in SQL code snippets (#8720)
Changed the SQL comment syntax from // to -- in packages/adapter-supabase/src/index.ts
2023-09-26 02:07:10 +02:00
Natsuki Ikeguchi
c9fc84ee82 build(deps): Remove better-sqlite3@7 (#8719) 2023-09-26 02:05:56 +02:00
Balázs Orbán
77933b23f0 chore: only validate bugs reports for repro links 2023-09-25 11:32:58 +02:00
Trần Minh Quang
cbbe27102e feat(providers): update LinkedIn to use OIDC (#8396)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-09-25 11:32:58 +02:00
GitHub Actions
e274c51807 chore(release): bump package version(s) [skip ci] 2023-09-24 13:46:27 +00:00
Thang Vu
2b3836d945 chore: add missing adapters in misc files 2023-09-24 20:30:31 +07:00
Thang Vu
b729f8af0b feat(adapters): azure tables adapter (#8708)
* feat(adapter): Add Azure Table Storage DB adapter

* add newlines

* remove sessionByUserId together with the session

* include import in the readme file

* add types to response objects

* introduce contracts for the db entities

* Rename the lib in docs

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

* run prettier

* feat: azure tables adapter

---------

Co-authored-by: Nikita Dmitriev <nikitadmitry@gmail.com>
Co-authored-by: Nikita Dmitriev <106996965+nikitaclicks@users.noreply.github.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2023-09-24 17:50:05 +07:00
Guy Korland
9f54222c0e fix(adapters): Avoid parseDataSourceConfig on each call (#8581)
Improve performance by avoiding call to parseDataSourceConfig before checking if _dataSource was already initialized.

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-24 10:18:30 +07:00
Joachim Bjørge
a5ac491cb8 fix(providers): optional chaining in azure-ad-b2c profile (#8616)
Fix crash in azure-ad-b2c.ts

Not all b2c-setups return a list of emails. This fixes the resulting crash by using defensive access when setting the profile email address field.

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-24 10:01:43 +07:00
Thang Vu
a96dcdbca3 chore: format surrealdb deps 2023-09-24 09:45:44 +07:00
Martin Schaer
bec01a82ea feat(adapters): add SurrealDB adapter (#6251)
* feat(adapter-surrealdb): implemented with unit tests

* chore: update README

* Use stateless DB connection

* Update surrealdb-rest-ts

* chore: bump turbo and pnpm

* chore(docs): fix dynamodb typo (#7130)

fix: typo

* chore: bump pnpm

* chore: update lock file, bump dev dependencies

* chore: run `pnpm install --fix-lockfile`

* chore: re-run pnpm install

* chore: add missing dev dep

* revert lock

* update lock

* use surrealdb.js

* add rest test

* remove commented-out code

* update readme

* modularize repeated code

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

* feat(adapters): add Account mapping before database write (#7369)

* feat: map Account before saving to database

* document `acconut()`, explain default behaviour

* generate `expires_at` based on `expires_in`

Fixes #6538

* rename

* strip undefined on `defaultProfile`

* don't forward defaults to account callback

* improve internal namings, types, docs

* chore: improve errors, add more docs (#7415)

* JWT Token -> JWT

* document some errors

* improve errors, docs

* fix: loosen profile types

* chore: type fixes

* fix: allow handling OAuth callback error response

related #7407

* fix(docs): remove extra heading

Fixes #7426

* chore: use `@ts-ignore`

* chore: support release any package as experimental

* chore: separate manual release job

* chore: skip test for manual release

* chore: tweak

* chore: tweaks

* chore: tweak manual release version

* Use query instead of select to be able to use query params

* Fix lint errors

* Update surrealdb.js and remove surrealdb-rest-ts in favor of ExperimentalSurrealHTTP

* update pnpm-lock

* fix merge

* fix merge

* fix merge

* migrate surrealdb.js api

* fix queries

* update package.json

* fix types

* prepare for rest

* update readme

* chore: format PR

* Update README.md

* Update package.json

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: jakzo <jack@jf.id.au>
Co-authored-by: Victor <saptefrativictor@gmail.com>
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-23 21:14:40 +07:00
GitHub Actions
6061bbcde1 chore(release): bump package version(s) [skip ci] 2023-09-22 08:16:24 +00:00
Thang Vu
09c5fe29ba chore: update d1 adapter 2023-09-22 15:08:07 +07:00
Thang Vu
6780ed7fee feat: add pg adapter (#8679)
* Add vanilla Postgres adapter for NextAuth using the pg package.

All tests are passing.

* Fix typo in readme

* Add basic tsconfig

* Replace this.getUser with functio body as this is undef

* Change name from @next-auth/postgres-adapter to @next-auth/pg-adapter

* Fix package folder to be same as name

* Add package to issue template, labeller and PR labeller

* Commit pnpm lock change.

* Set next-auth version to ^4

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

* Return user id when updating user. Fixes #4897.

* chore: format PR

* chore: format PR

* chore: formatting

* fix: tests

* fix

---------

Co-authored-by: Jake Coppinger <jake@jakecoppinger.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-09-22 14:49:01 +07:00
Kyle Roberts
5a7c1bb2bb docs: Remove asterisk that causes build error in oauth-tutorial.mdx (#8666)
Update oauth-tutorial.mdx

Remove * from example that's causing an unexpected character error
2023-09-20 19:47:40 +01:00
Kyle Roberts
6448a7b76e docs: Update SvelteKitAuth example default import to named import (#8603)
Update SvelteKitAuth example import to current non-default export
2023-09-20 11:15:28 +02:00
Balázs Orbán
db8fcc3c82 chore: Update invalid-reproduction.md 2023-09-19 16:04:13 +02:00
Bob Ippolito
9aeca63013 fix: Build account object with tokens spread as lowest priority (#8599) 2023-09-19 15:57:41 +02:00
Balázs Orbán
fee85f3138 chore: Rename help.yml to questions.yml 2023-09-19 15:56:34 +02:00
Balázs Orbán
e5bf8ec9c5 chore: move to nissuer for triaging (#8646) 2023-09-19 15:55:16 +02:00
Hamir Mahal
e3ec32812e chore: remove unnecessary comment (#8605)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-09-19 15:54:27 +02:00
k8pai
c776435268 fix(docs): correct import name (#8606) 2023-09-19 11:55:01 +02:00
GitHub Actions
d0cc046e2d chore(release): bump package version(s) [skip ci] 2023-09-16 13:48:09 +00:00
Thang Vu
c818d028aa fix: missing closing tag in adapters doc 2023-09-16 20:42:14 +07:00
Thang Vu
3ba8a0e40a chore: fix deps edgeDB 2023-09-16 18:23:50 +07:00
Josh Schlesser
770d3565f8 feat(adapter): add new Cloudflare D1 Adapter (#6953)
* cleaned everything up

* Added documentation

* fixed up d1 logo in docs

* cleaning out unused file

* changed to esm module

* formatting the PR

* update the deps

* update the deps

* ignore test

* ignore test

* fix deps

* add contributor

---------

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-16 18:17:02 +07:00
Hamir Mahal
ed32236712 docs: don't copy $ in commands (#8609)
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-16 09:56:57 +02:00
Thang Vu
307f7b5eb9 chore: Add EdgeDB in sidebar 2023-09-16 12:06:12 +07:00
Thang Vu
120d7a29ee chore: update email 2023-09-16 12:05:57 +07:00
GitHub Actions
ea65134a84 chore(release): bump package version(s) [skip ci] 2023-09-16 04:30:21 +00:00
Thang Vu
016b22833c chore(docs): add EdgeDB in typedoc 2023-09-16 11:21:48 +07:00
Bruno Crosier
67dbbb2cdf feat(adapters): new EdgeDB Adapter (#5781)
* init adapter folder

* add schema

* run migration

* run `npx @edgedb/generate edgeql-js`

* fix `generate` script

* add `EdgeDBAdapter`

* add tests

* add README

* docs

* dev app

* lockfile

* remove generated files

* ignore `dbschema/edgeql-js`

* add `postinstall` generate script

* update docs

* move `nonrecursive_access_policies` to default schema

* newlines

* remove js generation

* rewrite in edgeql

* make `userId` computed

* fix `createUser` image param

* code review comments

* update lockfile

* code review

* comments

* delete

* types

* revert settings.json

* delete migrations

* deps

* clean up

* Restore packages/adapter-test/index.ts

* chore: formatting & fix logic of useVerificationToken

* chore: delete .md file

* fix: test

* chore: logo

* chore: formatting

* chore: add edgedb to doc

---------

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-16 11:03:48 +07:00
Dewin Umana
f87e66f0b3 feat(providers): TikTok provider (#8131)
* feat(providers): TikTok provider

* Linting

* Move files under the correct paths

* Added Tiktok Provider

* Update Bug provider template
2023-09-15 12:14:44 +07:00
k8pai
b1c46809f5 fix(docs): remove typesafety statements as string (#8566)
Removed typesafety statement `as string` from Configuring Auth.js of /adapter-dynamodb
2023-09-12 14:42:25 +02:00
Thang Vu
b9e9722b74 feat(providers): Dribbble provider (#8531)
* feat(providers): add Dribbble provider

* update Dribbble

Co-Authored-By: Pavel Fomchenkov <hello@pavel.codes>

---------

Co-authored-by: Pavel Fomchenkov <hello@pavel.codes>
2023-09-09 14:07:24 +07:00
GitHub Actions
57f75c7839 chore(release): bump package version(s) [skip ci] 2023-09-07 15:59:48 +00:00
Jonas Strassel
e20eb5b583 feat: bump mongodb to v6 (#8492)
BREAKING CHANGE:

The required minimum version of `mongodb` has been bumped to v6, make sure to upgrade it in your project via `npm i mongodb@latest` or the equivalent
2023-09-07 17:54:16 +02:00
Thang Vu
fb7c5f9ef6 feat: Mastodon Provider (#8516)
Co-authored-by: Leif Arriens <30775450+leifarriens@users.noreply.github.com>
2023-09-07 22:18:11 +07:00
Anthony Shew
e986369906 docs: Add more detail to Credentials provider. (#8482)
* Soften messaging on Credentials provider documentation.

* Get rid of the swap.

* Switch to using authorize().
2023-09-06 00:24:27 +02:00
Antonio Basile
f3c64a85c9 feat(providers): Click up provider (#8489)
* feat: click up provider created

* docs: ClickUp documentation

* Format

---------

Co-authored-by: Antonio Basile <antoniobasile2@eng.it>
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-05 22:13:56 +07:00
GitHub Actions
4f3241f8dd chore(release): bump package version(s) [skip ci] 2023-09-04 23:02:35 +00:00
Jason
65043ba471 fix: return Session from deleteSession() (#8484)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-09-04 16:17:48 +02:00
Balázs Orbán
46c5a97a0e chore: add passage issuer 2023-09-03 13:24:03 +02:00
Balázs Orbán
9f99066b19 chore: update NextAuth.js example to use App Router (#8477)
* move initiaization to App Router

* add more providers

* don't use default export

* update tsconfig

* move under api

* add more providers

* add issuer

* add issuer
2023-09-03 11:59:58 +01:00
Menushka Weeratunga
e266001c28 docs: Add SvelteKit OAuth tutorial docs (#8311)
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-02 10:11:31 +07:00
Thang Vu
f1eb45f3c1 docs: Add callbacks example for Credential Provider 2023-09-02 09:40:31 +07:00
jonek
f621627914 fix(sveltekit): support custom base path properly (#8231)
* fix(sveltekit): support custom base path

* update server

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-09-02 00:03:22 +07:00
dependabot[bot]
2b6ad02bba chore(deps-dev): bump mongodb from 4.7.0 to 4.17.0 (#8461)
Bumps [mongodb](https://github.com/mongodb/node-mongodb-native) from 4.7.0 to 4.17.0.
- [Release notes](https://github.com/mongodb/node-mongodb-native/releases)
- [Changelog](https://github.com/mongodb/node-mongodb-native/blob/v4.17.0/HISTORY.md)
- [Commits](https://github.com/mongodb/node-mongodb-native/compare/v4.7.0...v4.17.0)

---
updated-dependencies:
- dependency-name: mongodb
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-01 13:14:49 +01:00
GitHub Actions
1a23e41bca chore(release): bump package version(s) [skip ci] 2023-09-01 12:13:47 +00:00
Balázs Orbán
9dfef763fc chore: bump pnpm 2023-09-01 13:54:59 +02:00
Balázs Orbán
f53c16a454 chore: fix supabase tests 2023-09-01 13:53:18 +02:00
Thang Vu
e999511a2e docs: add framework tabs in getting started & guide (#8470) 2023-09-01 13:45:16 +02:00
Rexford Essilfie
2707f9ebfe docs: fix failing docs build (#8463)
chore: lint azure-devops provider
2023-08-31 14:35:40 +01:00
Evgenii Perminov
35977bf132 fix(providers): Update type oidc for Linkedin (#8345)
* linked in provider options and profile update

* interface update

* removed unchecked property access

* unncessary async

* revert changes to v4

* fallback to default properties

* Update packages/core/src/providers/linkedin.ts

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-08-29 11:31:18 +07:00
Pavel Fomchenkov
578ff21d7e feat(providers): add Azure DevOps provider (#4698) 2023-08-27 20:50:59 +07:00
Balázs Orbán
ba238796b8 Merge branch 'main' of github.com:nextauthjs/next-auth 2023-08-25 11:56:22 +02:00
Balázs Orbán
56b27de3be docs: fix edit links for auto-generated pages 2023-08-25 11:56:18 +02:00
Ahmed Abdelbaset
0bc9b4fe5a docs: Correct a typo that is causing a broken link. (#8405)
fix broken link
2023-08-25 10:43:44 +01:00
Balázs Orbán
327061ce70 chore: revert typedoc 2023-08-25 11:39:11 +02:00
Balázs Orbán
2ed407d6a5 fix: allow Prisma v5 as peer dependency 2023-08-25 11:32:38 +02:00
Balázs Orbán
e743340612 chore: suppress TS warning in sveltekit 2023-08-25 11:26:20 +02:00
Balázs Orbán
5140857256 chore: fix deps, upgrade docs dependencies 2023-08-25 11:21:55 +02:00
Balázs Orbán
9c6f81308c chore: bump pnpm and typescript 2023-08-24 20:31:33 +02:00
JunChao
66184c55eb docs: change var to import to solve using https-proxy-agent have the error: "HttpsProxyAgent is not a constructor" (#8400)
Update corporate-proxy.md
2023-08-24 14:54:23 +02:00
Balázs Orbán
07599ba41d Merge branch 'main' of github.com:nextauthjs/next-auth 2023-08-24 11:20:49 +02:00
Balázs Orbán
c5fc3e66ad docs: rename @next-auth/* to @auth/* 2023-08-24 11:20:44 +02:00
Balázs Orbán
5dfec49ee8 chore: rename @next-auth/* packages to @auth/* 2023-08-24 11:18:04 +02:00
brunsten
b20182c5fe fix: handle trailing slash when parsing the url (#8383)
Co-authored-by: Marcus Brunsten <bruno@Marcuss-MacBook-Rd.local>
2023-08-22 15:59:52 +02:00
Balázs Orbán
a6d9459a64 chore: mention that no repro = convert to discussion 2023-08-21 10:28:01 +01:00
GitHub Actions
99035b98f9 chore(release): bump package version(s) [skip ci] 2023-08-18 08:13:39 +00:00
Balázs Orbán
fabb0525d1 fix(adapters): use built-in is() to identify db type (#8342)
* fix(adapters): use built-in `is()` to identify db type

* remove unused .then

* fix imports
2023-08-18 09:11:33 +01:00
GitHub Actions
28e4328704 chore(release): bump package version(s) [skip ci] 2023-08-14 14:46:10 +00:00
Balázs Orbán
7ff4d9d280 feat: allow raw response for lib authors 2023-08-14 16:39:11 +02:00
Balázs Orbán
26815f7621 docs: clean up roadmap 2023-08-12 12:50:31 +02:00
Balázs Orbán
fe2c3dc6bf docs: fix links, references, grammar 2023-08-12 12:23:17 +02:00
GitHub Actions
c53435af8a chore(release): bump package version(s) [skip ci] 2023-08-12 09:41:43 +00:00
Balázs Orbán
f29a1f2778 fix(release): include lib in package
Related issue #8299
2023-08-12 11:38:01 +02:00
Balázs Orbán
a4c3270307 chore(turbo): include lib in cache outputs
Closes #8299
2023-08-12 11:35:44 +02:00
GitHub Actions
645d003d49 chore(release): bump package version(s) [skip ci] 2023-08-11 11:31:12 +00:00
Balázs Orbán
3f296615c5 fix(providers): docs typo 2023-08-11 13:27:33 +02:00
GitHub Actions
a7842077ec chore(release): bump package version(s) [skip ci] 2023-08-11 11:26:36 +00:00
Balázs Orbán
b2e5b9f6a8 feat(providers): add Passage by 1Password (#8295) 2023-08-11 12:23:27 +01:00
GitHub Actions
0681531627 chore(release): bump package version(s) [skip ci] 2023-08-11 10:29:05 +00:00
Balázs Orbán
ea81c467e9 fix(ts): compatibility with next-auth v4 types (#8294)
* fix(ts): compatibility with `next-auth` v4

* revert

* stricter types
2023-08-11 11:26:03 +01:00
GitHub Actions
bf2835d38f chore(release): bump package version(s) [skip ci] 2023-08-11 08:26:58 +00:00
Simon Sardorf
89d230666b feat(adapters): standardize default table names to be singular (#8282)
standardize all table names in drizzle adapter to be singular
2023-08-10 12:18:21 +01:00
Jonathan Edenström
f86e56f78a fix: sort cookie chunks correctly (#8278)
* fix: sort cookie chunks correctly

* chore: remove v4 next-auth change
2023-08-10 12:18:00 +01:00
Balázs Orbán
fe20b943ae docs: Update README.md 2023-08-10 00:57:02 +02:00
Balázs Orbán
4678c4d4fc docs: Update README.md 2023-08-10 00:56:24 +02:00
Balázs Orbán
3eb3f8f107 docs: typo 2023-08-09 23:15:35 +02:00
Balázs Orbán
7fd03f38e3 docs: remove heading from README.md 2023-08-09 23:14:53 +02:00
Balázs Orbán
ae44b72765 Merge branch 'main' of github.com:nextauthjs/next-auth 2023-08-09 23:08:13 +02:00
Balázs Orbán
a996ab57e8 🤖 lazy commit 2023-08-09 23:07:28 +02:00
Thang Vu
ebdeaf740d chore: move Turbo env vars to top level 2023-08-09 19:07:01 +07:00
GitHub Actions
c5c8a81462 chore(release): bump package version(s) [skip ci] 2023-08-09 09:39:28 +00:00
Balázs Orbán
61d30f3dcd fix(docs): correct broken link 2023-08-09 11:33:17 +02:00
Balázs Orbán
a9180a752b fix(docs): correct broken links 2023-08-09 11:33:08 +02:00
Balázs Orbán
6c4180146e chore(docs): add @auth/solid-start to turbo cache 2023-08-09 11:28:37 +02:00
Balázs Orbán
ec6c4ea2be docs: fix redirects 2023-08-09 11:20:10 +02:00
Balázs Orbán
3dfc86334e docs: fix redirects 2023-08-09 11:13:36 +02:00
Balázs Orbán
01d6019638 docs: fix redirects 2023-08-09 11:07:20 +02:00
GitHub Actions
4730429a9f chore(release): bump package version(s) [skip ci] 2023-08-09 09:05:20 +00:00
Adam James
a49236ef62 fix(ts): corrected sqlite condition (#8269) 2023-08-09 10:59:08 +02:00
Balázs Orbán
96ade948ef chore(docs): fix redirect 2023-08-09 01:08:58 +02:00
GitHub Actions
550507b2d1 chore(release): bump package version(s) [skip ci] 2023-08-08 23:07:59 +00:00
Mark
1eddcf643c feat(adapters): add Kysely adapter (#5464)
* feat: kysely-adapter with PostgreSQL and MySQL support

* feat: kysely-adapter with SQLite support

* docs: add docs for kysely-adapter

* chore: cleanup

* chore: update adapter lists

* chore: update column types

* chore: remove pgcrypto install

* chore: add indexes

* chore: Object.assign and cleanup

* feat: add AuthedKysely wrapper

* docs: add Naming Conventions section

* chore: add coerceReturnData to reduce repitition

* chore: add coerceInputData to reduce repitition

* chore: move AuthedKysely export to end

* chore: cleanup

* docs: remove unused import

* feat: add support for using AuthedKysely with generated types from kysely-codegen

* docs: formatting

* chore: CodeGen --> Codegen

* docs: wording update, ts

Co-authored-by: Julius Marminge <julius0216@outlook.com>

* chore: use latest kysely version, update model

* docs: move content to source code

* chore: update deps

* chore: update logo location, add link in overview

* chore: bump kysely version

Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>

* chore: update docs

Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>

* chore: update docs with links to new Kysely docs

Co-authored-by: Jie Peng <dean.leehom@gmail.com>

* feat: emailVerified shouldn't have a default

Co-authored-by: Lars Graubner <lgraubner@users.noreply.github.com>

* simplify, update code

* add README.md

* clean up docs

* fix adapter name

* add to turbo

* fix test

* revert some changes

* test fixes

---------

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
Co-authored-by: Jie Peng <dean.leehom@gmail.com>
Co-authored-by: Lars Graubner <lgraubner@users.noreply.github.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-08-09 00:01:59 +01:00
Julius Marminge
17d71a04d6 feat(adapters): support multi-project schema (#8266)
* feat: multi-project schema support

Ref: https://orm.drizzle.team/docs/goodies#multi-project-schema

* Update index.ts

* Update index.ts

* doc

* tests

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-08-08 23:59:50 +01:00
Balázs Orbán
3c65e264af chore: add drizzle to issue labeler 2023-08-09 00:44:54 +02:00
Balázs Orbán
28d8d4894d chore: add drizzle to turbo 2023-08-09 00:43:49 +02:00
Balázs Orbán
c6b98a8f08 chore: gitignore generated .npmrc files 2023-08-09 00:03:10 +02:00
Balázs Orbán
d042f933c6 fix(docs): update logo URL 2023-08-09 00:01:44 +02:00
GitHub Actions
3a85de2c5f chore(release): bump package version(s) [skip ci] 2023-08-08 17:38:45 +00:00
Balázs Orbán
d47b56743e feat(adapters): Drizzle adapter (#8258)
Co-authored-by: Anthony Shew <anthonyshew@gmail.com>
2023-08-08 19:34:17 +02:00
Balázs Orbán
363440e515 chore: disable debug logs 2023-08-08 14:32:11 +02:00
Thang Vu
60c5037ee1 chore: remove summarize turbo 2023-08-04 12:39:04 +07:00
Thang Vu
97394baed1 chore: change to vars for TURBO_TEAM 2023-08-04 12:02:43 +07:00
Thang Vu
f94abb8f70 chore: add -vvv for turbo 2023-08-04 11:42:00 +07:00
titanism
bbfc11e74c docs: updated nodemailer email example (#8210) 2023-08-03 16:14:39 +02:00
dependabot[bot]
2a70514df1 chore(deps-dev): bump vite from 4.0.1 to 4.0.5 (#8225)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-03 16:11:30 +02:00
Jabed
96d666465f docs: fixed the typescript error in nextjs example (#8224) 2023-08-03 15:58:37 +02:00
Danny Zhang
ecbf0be22e docs: correct broken CONTRIBUTING.md link in apps/dev/nextjs-v4 (#8163) 2023-07-31 11:23:32 +02:00
hamzah syed
87ec13bd00 docs: Fixed broken link (#8172) 2023-07-31 11:23:10 +02:00
Steven Yung
c0f9af4c56 docs: fix GitHub star counter position (#8143) 2023-07-26 15:04:12 +02:00
Balázs Orbán
c7b36f45a3 docs: update nodemailer link
Fixes #8141
2023-07-26 14:57:22 +02:00
Thang Vu
68ff69f9eb chore: upload turbo cache (#8128)
* Update index.ts

* Revert "Update index.ts"

This reverts commit f494291c7385d50e5e8cba65258893925808fa43.

* try this

* Update release.yml

* Update release.yml

* try

* Update turbo.json

* Update release.yml

* Update README.md

* Revert "Update README.md"

This reverts commit a5e56687e0bb60fcefb6c7a2f36d7135fb365e61.

* Update pnpm-workspace.yaml
2023-07-25 22:31:20 +07:00
Thang Vu
23c0a393da chore: add summarize flag for test 2023-07-24 23:31:31 +07:00
Thang Vu
f130f62a91 chore: ignore apps in test 2023-07-24 20:19:45 +07:00
Thang Vu
c111b436d2 chore: update turbo configurations 2023-07-24 19:39:06 +07:00
Thang Vu
ea895b8864 chore: add TURBO env vars back 2023-07-24 19:20:31 +07:00
Thang Vu
cfedc3b1a3 chore: bump next in dev 2023-07-24 19:01:12 +07:00
Thang Vu
287a5fc05a chore: clean up dev & lock file 2023-07-24 19:00:26 +07:00
Thang Vu
f3ad659e91 chore: remove TURBO env vars 2023-07-24 18:52:25 +07:00
Thang Vu
48b9a0203e chore: dev environment clean up 2023-07-23 14:13:31 +07:00
Thang Vu
39fbccb783 fix: follow up allow EndpointRequest to return void type 2023-07-23 14:10:46 +07:00
Junseo
f207e94146 fix(ts): allow EndpointRequest to return void type (#8112)
* fix: fix: enable EndpointRequest type to return void type

* Update packages/next-auth/src/providers/oauth.ts

* Update packages/core/src/providers/oauth.ts

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-07-22 23:05:29 +07:00
Serdar ŞEN
b845729cdb docs: update getting started commands for docs (#8040)
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-07-22 12:53:03 +07:00
GitHub Actions
e459d2d7e2 chore(release): bump package version(s) [skip ci] 2023-07-18 14:40:11 +00:00
Thang Vu
db1fd9007c fix(ts): types in sveltekit 2023-07-18 21:29:04 +07:00
Thang Vu
0439fc5fc6 feat(providers): add request param to sendVerificationRequest (#8071)
Co-authored-by: Corey Jepperson <11298888+acoreyj@users.noreply.github.com>
2023-07-18 15:39:11 +02:00
Benjamin Tamasi
d0dd2ababc fix(sveltekit): prefix for getSession url (#6478)
* [SvelteKit] fix getSession url

remove `/api` prefix from getSession function.

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

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
2023-07-16 21:01:25 +07:00
Thang Vu
ba58d48dba fix(providers): add authorization params for AzureAD (#8047)
https: //github.com/nextauthjs/next-auth/pull/5668

Co-authored-by: Andres Jose Sebastian Rincon Gonzalez <2531975+stianrincon@users.noreply.github.com>
2023-07-15 22:01:24 +07:00
Thang Vu
a8d76ed440 fix(ts): require id for updateUser param (#8044)
https: //github.com/nextauthjs/next-auth/pull/5431

Co-authored-by: Yuri Sulyma <453486+ysulyma@users.noreply.github.com>
2023-07-15 17:18:15 +07:00
Thang Vu
3d7b8720db chore(docs): OIDC example for BoxyHQ (#8032)
chore(docs): OIDC example for BoxyHQ

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
2023-07-13 23:43:10 +07:00
Francis Gulotta
1e886b97bc fix(EmailProvider): proper required fields and allow all nodemailer types (#8016) 2023-07-11 18:01:47 +02:00
Tal Aharoni
ecb14ccecd fix: correct Descope provider config (#8003) 2023-07-11 12:51:32 +02:00
GitHub Actions
8cee24d4ab chore(release): bump package version(s) [skip ci] 2023-07-10 19:40:53 +00:00
Balázs Orbán
0189a197be chore: fix syntax in package.json 2023-07-10 21:29:38 +02:00
Balázs Orbán
c44bf75c65 fix: add svelte as peer dependency
Fixes #8004
2023-07-10 21:27:16 +02:00
GitHub Actions
cf13b6c7e3 chore(release): bump package version(s) [skip ci] 2023-07-10 16:21:19 +00:00
Dahoom152
dc1a79e547 fix: drop svelte as peer dependency (#7989)
* optionally bumped to svelte 4.0

* removed redundancy

* Update package.json

* Update package.json

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-07-10 18:10:29 +02:00
arjun
78964c115b fix(adapters): add missing .js file extension (#7971)
Add missing .js file extension
2023-07-07 17:05:07 +02:00
Balázs Orbán
7fa51e2a61 docs: clarify preview deployment guide 2023-07-06 16:44:31 +02:00
Gwenaël Gallon
a79774f6e8 fix(docs): fix catch-all route path (#7925) 2023-07-01 01:36:23 +02:00
Fatih Solhan
f779f05906 docs: remove extra 'if' in comment (#7914) 2023-06-30 21:00:28 +02:00
GitHub Actions
3245c02eac chore(release): bump package version(s) [skip ci] 2023-06-27 15:22:02 +00:00
Doron Sharon
a8dfc8ebb1 feat(providers): Add Descope provider (#7874)
* Add Descope provider

* Add Descope provider

* Remove dark logo, remove wellKnown, and fix user profile syntax

* Change to DESCOPE_SECRET

* Fix env comment

* Fix clientId extracting

* Change to client id
2023-06-26 18:18:58 +02:00
Esteve
1b80a18dd4 fix(adapters): Add .js file extension to relative imports (#7856)
Add .js file extension to relative imports
2023-06-24 10:21:50 +02:00
GitHub Actions
50a88bb878 chore(release): bump package version(s) [skip ci] 2023-06-22 12:50:36 +00:00
Balázs Orbán
a359a562ce fix: correctly assert protocol 2023-06-22 14:27:44 +02:00
GitHub Actions
7edb9cf53f chore(release): bump package version(s) [skip ci] 2023-06-21 07:57:50 +00:00
Balázs Orbán
018b086c4f chore: fix tests 2023-06-21 09:42:46 +02:00
Balázs Orbán
173000a068 fix: add .js extension
fixes #7826
2023-06-21 09:14:03 +02:00
Balázs Orbán
8fcd46b0fc fix(ts): loosen Profile type 2023-06-20 17:15:22 +02:00
GitHub Actions
d5d1313914 chore(release): bump package version(s) [skip ci] 2023-06-14 13:07:32 +00:00
Balázs Orbán
3285d04241 fix(build): use correct tsconfig 2023-06-14 14:51:50 +02:00
Balázs Orbán
fe442522ef fix(client): remove unused declaration 2023-06-14 14:48:22 +02:00
GitHub Actions
6c9dfff45f chore(release): bump package version(s) [skip ci] 2023-06-14 12:47:31 +00:00
Balázs Orbán
ef50916ec2 fix(ts): correct user type reference 2023-06-14 14:37:34 +02:00
GitHub Actions
8e771a2993 chore(release): bump package version(s) [skip ci] 2023-06-14 12:22:38 +00:00
Balázs Orbán
06a7149b66 feat: introduce @auth/supabase-adapter (#7807)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/supabase-adapter": "0.0.0",
+  "@auth/supabase-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only
2023-06-14 13:09:29 +01:00
Balázs Orbán
662e0942cb feat: introduce @auth/xata-adapter (#7808)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/xata-adapter": "0.0.0",
+  "@auth/xata-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only
2023-06-14 13:09:14 +01:00
Balázs Orbán
91c71a175b chore: fix version 2023-06-14 14:08:13 +02:00
Balázs Orbán
3b8c75297b fix: use correct import 2023-06-14 13:50:30 +02:00
Balázs Orbán
5d06fa5852 feat: introduce @auth/sequelize-adapter (#7806)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/sequelize-adapter": "0.0.0",
+  "@auth/sequelize-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only
2023-06-14 12:38:15 +01:00
Balázs Orbán
e7a52077c5 feat: introduce @auth/pouchdb-adapter (#7805)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/pouchdb-adapter": "0.0.0",
+  "@auth/pouchdb-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only

This package assumes that `globalThis.crypto` is available.

In older Node.js versions, you can polyfill by adding:

`globalThis.crypto ??= require("node:crypto").webcrypto`
2023-06-14 12:28:39 +01:00
Balázs Orbán
6e4516a9f8 feat: introduce @auth/neo4j-adapter (#7804)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/neo4j-adapter": "0.0.0",
+  "@auth/neo4j-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only

This package assumes that `globalThis.crypto` is available.

In older Node.js versions, you can polyfill by adding:

`globalThis.crypto ??= require("node:crypto").webcrypto`
2023-06-14 12:26:38 +01:00
Balázs Orbán
8a0b11fcd6 chore: reset version 2023-06-14 12:03:07 +01:00
Balázs Orbán
f925e0c2a5 feat: introduce @auth/firebase-adapter (#7803)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/firebase-adapter": "0.0.0",
+  "@auth/firebase-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only
2023-06-14 12:02:24 +01:00
Balázs Orbán
de4e20cc04 feat: introduce @auth/fauna-adapter (#7802)
* feat: introduce `@auth/fauna-adapter`

Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/fauna-adapter": "0.0.0",
+  "@auth/fauna-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only
2023-06-14 12:00:40 +01:00
GitHub Actions
65f4b9c942 chore(release): bump package version(s) [skip ci] 2023-06-13 15:02:46 +00:00
Balázs Orbán
1d29b0d220 feat: introduce @auth/mikro-orm-adapter (#7794)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/mikro-orm-adapter": "0.0.0",
+  "@auth/mikro-orm-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only

This package assumes that `globalThis.crypto` is available.

In older Node.js versions, you can polyfill by adding:

`globalThis.crypto ??= require("node:crypto").webcrypto`
2023-06-13 15:39:43 +01:00
Balázs Orbán
cd92aa0c82 feat: introduce @auth/dynamodb-adapter (#7793)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/dynamodb-adapter": "0.0.0",
+  "@auth/dynamodb-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only

This package assumes that `globalThis.crypto` is available.

In older Node.js versions, you can polyfill by adding:

`globalThis.crypto ??= require("node:crypto").webcrypto`
2023-06-13 15:28:33 +01:00
Balázs Orbán
d414e01181 feat: introduce @auth/dgraph-adapter (#7792)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.
    
BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/dgraph-adapter": "0.0.0",
+  "@auth/dgraph-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only

`fetch` is not polyfilled anymore.

In older Node.js versions, you can use the  `--experimental-fetch` flag, or install `undici` and add the following line:

`globalThis.fetch ??= require("undici").fetch`
2023-06-13 14:31:04 +01:00
GitHub Actions
43deda5bfb chore(release): bump package version(s) [skip ci] 2023-06-13 12:49:24 +00:00
Balázs Orbán
7e79d8c509 feat: introduce @auth/upstash-redis-adapter (#7791)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/upstash-redis-adapter": "0.0.0",
+  "@auth/upstash-redis-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only

This package assumes that `globalThis.crypto` is available.

In older Node.js versions, you can polyfill by adding:

`globalThis.crypto ??= require("node:crypto").webcrypto`
2023-06-13 14:36:38 +02:00
Balázs Orbán
ab051162a7 chore: reset @auth/mongodb-adapter version 2023-06-13 13:02:19 +01:00
Balázs Orbán
87298a0150 feat: introduce @auth/mongodb-adapter (#7790)
Database adapters are not dependent on Next.js features, so it makes sense to republish them under the `@auth/*` scope.

This PR is part of a series to convert adapters, using `@auth/core` for types.

BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/mongodb-adapter": "0.0.0",
+  "@auth/mongodb-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only
2023-06-13 13:41:12 +02:00
GitHub Actions
d6abccd9a0 chore(release): bump package version(s) [skip ci] 2023-06-13 11:37:54 +00:00
Josua Frank
2f35daae37 fix(client): respect { redirect: true } in signIn() (#7775)
* Fix `signIn()` not respecting `{ redirect: true }`

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-06-13 12:14:49 +01:00
Koen Bolhuis
a0f3b04c43 docs: Fix typo in email tutorial (#7769) 2023-06-13 12:11:04 +01:00
GitHub Actions
c7dec376a1 chore(release): bump package version(s) [skip ci] 2023-06-05 21:41:46 +00:00
Gage Keenan
925a52e0ec fix: sort chunked session cookies (#7736)
Update cookie.ts
2023-06-05 17:36:10 +01:00
Imamuzzaki Abu Salam
2318e44de4 docs(cypress): update file config to latest cypress c… (#7733)
docs(testing-with-cypress.md): update file config to latest cypress config filename
2023-06-05 17:33:37 +01:00
GitHub Actions
d73812bce5 chore(release): bump package version(s) [skip ci] 2023-06-01 17:21:47 +00:00
Balázs Orbán
ee36d09a08 chore: drop Legacy from naming everywhere 2023-06-01 19:05:44 +02:00
Balázs Orbán
0cb7fd2e7c feat: introduce @auth/typeorm-adapter (#7706)
BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/typeorm-legacy-adapter": "0.0.0",
+  "@auth/typeorm-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only
2023-06-01 17:52:11 +01:00
GitHub Actions
3b414bd7b5 chore(release): bump package version(s) [skip ci] 2023-06-01 14:19:07 +00:00
Balázs Orbán
37bb6ebd2c fix(docs): update code example 2023-06-01 16:08:21 +02:00
Balázs Orbán
2ecf52c342 feat: introduce @auth/prisma-adapter (#7703)
BREAKING CHANGE:
If you are coming from the previous adapter, change your `package.json`:

```diff
-  "@next-auth/prisma-adapter": "0.0.0",
+  "@auth/prisma-adapter": "0.0.0",
```

And run `npm install`, `yarn install` or `pnpm install` respectively.

**Note:** This packages is published as ESM-only.
2023-06-01 16:06:22 +02:00
Balázs Orbán
cda07c239e chore: remove "nuxt postinstall" 2023-06-01 15:17:58 +02:00
Balázs Orbán
fa60b79abe chore: upgrade turbo 2023-06-01 15:15:23 +02:00
GitHub Actions
39e1a76e8f chore(release): bump package version(s) [skip ci] 2023-06-01 12:59:53 +00:00
Balázs Orbán
953ef9d04a chore: re-add pnpm caching
Related: #7332
2023-06-01 14:49:45 +02:00
Balázs Orbán
94f3031765 chore: allow manual release of any @auth/* package 2023-06-01 14:49:45 +02:00
Balázs Orbán
ad7bf07ddf chore: update lock file 2023-06-01 14:49:45 +02:00
Graham Charles
f30308ac30 docs: fix info card rendering in oauth-tutorial.mdx (#7662)
Info box is not being rendered; the raw `:::info` is displayed. Blind guess: it needs a blank line before it.
2023-06-01 14:49:45 +02:00
Tashrik Anam
6eaaeb15e9 docs: adapter card text color on hover when on dark mode (#7672) 2023-06-01 14:49:45 +02:00
Robert Soriano
8b3f0696a5 chore(playgrounds): Nuxt 3.5.1 (#7626)
* bump Nuxt to 3.5.1

* follow playground package names

* chore: update nuxt playground scripts

* fix: imports and types

* fix: more nuxt type imports

* fix: nuxt auth options types

* fix: nuxt client fetch types
2023-06-01 14:49:45 +02:00
Doron Sharon
c69a157832 chore: Add Descope as a 🥉 bronze financial sponsor (#7615)
Add Descope as a bronze sponsor
2023-06-01 14:49:45 +02:00
TATHAGATA ROY
60af446338 docs: Cypress.Cookies.defaults removed (#7574) 2023-06-01 14:49:45 +02:00
Nirmalya Ghosh
ce85444760 chore: Move next.config.js file into the correct directory (#7580)
fix: moves next config file into the correct directory
2023-06-01 14:49:45 +02:00
Balázs Orbán
142abe3eea feat: allow empty account mapper 2023-06-01 14:49:45 +02:00
Balázs Orbán
da211e6cbe chore: revert picture to image 2023-06-01 14:49:45 +02:00
Balázs Orbán
79ad6156ed feat: add update session to core (#7505)
* feat: add update session to core

Integrates #7056 into `@auth/core`

* resolve default user after jwt callback
2023-06-01 14:49:45 +02:00
Rémi Robichet
28f287d63e docs(example): update broken link (#7504)
Co-authored-by: Nico Domino <yo@ndo.dev>
2023-06-01 14:49:45 +02:00
Balázs Orbán
1ab77d0e11 chore: move build to root 2023-06-01 14:49:45 +02:00
Balázs Orbán
787c1ff7d0 chore: add build to manual publish 2023-06-01 14:49:45 +02:00
Balázs Orbán
208b3b4a43 chore: reduce breaking changes on Account mapping
Reverts some changes on #7369 so DB migration won't be needed
2023-06-01 14:49:45 +02:00
Balázs Orbán
c4f6330f70 chore: tweak manual release version 2023-06-01 14:49:45 +02:00
Balázs Orbán
44127068e1 chore: tweaks 2023-06-01 14:49:45 +02:00
Balázs Orbán
9e3f1aacf7 chore: tweak 2023-06-01 14:49:45 +02:00
Balázs Orbán
83051c6862 chore: skip test for manual release 2023-06-01 14:49:45 +02:00
Balázs Orbán
f1acab67e6 chore: separate manual release job 2023-06-01 14:49:45 +02:00
Balázs Orbán
6a31ed3216 chore: support release any package as experimental 2023-06-01 14:49:45 +02:00
Balázs Orbán
0998fc0b98 chore: use @ts-ignore 2023-06-01 14:49:45 +02:00
Balázs Orbán
bd20d750c2 fix(docs): remove extra heading
Fixes #7426
2023-06-01 14:49:45 +02:00
Balázs Orbán
8e29b4df0c fix: allow handling OAuth callback error response
related #7407
2023-06-01 14:49:45 +02:00
Balázs Orbán
9632a56d45 chore: type fixes 2023-06-01 14:49:45 +02:00
Balázs Orbán
12161b9613 fix: loosen profile types 2023-06-01 14:49:45 +02:00
Balázs Orbán
a3b5276a5a chore: improve errors, add more docs (#7415)
* JWT Token -> JWT

* document some errors

* improve errors, docs
2023-06-01 14:49:45 +02:00
Balázs Orbán
7c1078b9a9 feat(adapters): add Account mapping before database write (#7369)
* feat: map Account before saving to database

* document `acconut()`, explain default behaviour

* generate `expires_at` based on `expires_in`

Fixes #6538

* rename

* strip undefined on `defaultProfile`

* don't forward defaults to account callback

* improve internal namings, types, docs
2023-06-01 14:49:45 +02:00
Victor
37d3461155 docs: fix default maxAge formula (#7406) 2023-06-01 14:49:40 +02:00
Balázs Orbán
6111662df7 docs: Update creating-a-database-adapter.md 2023-04-30 09:52:47 +02:00
Zack Reneau-Wedeen
5da6549c48 chore(docs): update xata docs link (#7397)
Update link to a working page (Workspaces API reference)

Co-authored-by: Nico Domino <yo@ndo.dev>
2023-04-28 22:26:30 +02:00
GitHub Actions
1ca87809d6 chore(release): bump package version(s) [skip ci] 2023-04-28 15:09:12 +00:00
Balázs Orbán
7f6967fc3c chore: update lock file 2023-04-28 16:55:31 +02:00
Dawid Weltrowski-Knopik
2313ef63e0 fix(adapters): allow neo4j-driver@5 as a peer dependency (#7392)
* upgrade neo4j-driver

* Correcting depdendency to also allow for ^4.0.0 and pnpm install

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-04-28 15:54:48 +01:00
Balázs Orbán
523fcbab71 fix(docs): document Callback URL for every provider 2023-04-28 16:52:10 +02:00
Balázs Orbán
83d8b447db chore: clean up Next.js example 2023-04-28 09:50:44 +02:00
Balázs Orbán
ddffa57d00 docs: fix syntax error 2023-04-27 10:06:12 +01:00
peterhirn
807d5d7920 fix(ts): support moduleResolution node16 and nodenext (#7351) (#7374) 2023-04-27 10:03:25 +01:00
RubenSmn
0f0dd9228a docs: fix code snippet being smushed on mobile (#7197) 2023-04-26 13:06:11 +01:00
Jack Oats
b087fdb817 docs: resize icons on screen size change (#7309)
* Update size of icons on load && on resize event

Added 'use client' since window object would only be defined on client side ( and using hooks );
Thought it'd be a cool feature to add :)

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-04-26 13:00:15 +01:00
Lluis Agusti
443bfd6c32 fix(docs): move provider docs to source code (#7275)
* chore: wip

* chore: wip

* zoom, zoho, ZITADEL

* add logos for Zoom, zoho, zitadel

* add the rest of the providers

* add logos

* revert typo

* move icons to docs

---------

Co-authored-by: Thang Vu <hi@thvu.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-04-24 09:21:24 +01:00
Balázs Orbán
7c44d916ed chore: fix Next.js example sync 2023-04-23 08:14:52 +01:00
John Abdou
b489fef2e2 docs: fix link (#7334)
* Fixed broken link to auth.js core documentation

* Update README.md

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-04-23 09:22:14 +03:00
Balázs Orbán
98add24526 chore: bump react types 2023-04-21 12:25:48 +02:00
GitHub Actions
0ddd47cc0a chore(release): bump package version(s) [skip ci] 2023-04-20 09:38:01 +00:00
Balázs Orbán
0100888d9b fix: consume nonce exactly once (#7327)
* fix: consume nonce exactly once

* tweak state handling
2023-04-20 10:25:41 +01:00
Balázs Orbán
9eeea02fe2 feat: redirect proxy (#7326)
* types

* add `redirectProxy` option

* ignore if no state

* empty commit

* tweak proxy detection

* add origin proxy check to checks

* run randomstate decode

* don't generate state data when no proxy

* ignore next-2

* update dev app

* clarify `UnknownAction` error

* rename to `AUTH_REDIRECT_PROXY_URL`

* simplify state

* clear todos

* cleanup

* clarify comment

* use `InalidChecks` error

* simplify

* clarify errors

* add debug logger to redirect proxy

* add proxy redirect logger

* don't throw error when no origin on proxy

* fix redirect_uri in callback

* add docs/guide

* sort imports

* docs: rephrase
2023-04-20 09:53:44 +01:00
GitHub Actions
0a57fea430 chore(release): bump package version(s) [skip ci] 2023-04-20 08:41:41 +00:00
Tim Schneider
51750e1a06 fix(adapters): correct peer dependency (#7310)
Typo in package.json

Missing | in package.json causing ETARGET and peer dependency errors
2023-04-20 09:23:30 +01:00
Balázs Orbán
039a14d992 fix: clarify unknown action error 2023-04-19 10:40:51 +02:00
Balázs Orbán
da821d2789 chore: cleanup todos, format 2023-04-19 10:40:42 +02:00
Balázs Orbán
be5c42e350 Merge branch 'main' of github.com:nextauthjs/next-auth 2023-04-19 10:36:50 +02:00
Balázs Orbán
b68f461f8b chore: upgrade next 2023-04-19 10:35:34 +02:00
Nick Parsons
95c5ba0b5d docs: Update Clerk sponsorship URL (#7305)
- Change Clerk URL from `https://clerk.dev` to `https://clerk.com`

- Fix alt from copy/paste
2023-04-18 20:13:19 +01:00
GitHub Actions
25388de027 chore(release): bump package version(s) [skip ci] 2023-04-18 17:45:29 +00:00
Balázs Orbán
ad77e1c2b7 chore: trigger CI 2023-04-18 19:31:51 +02:00
Balázs Orbán
cd654c3001 chore: trigger CI 2023-04-18 19:09:53 +02:00
Balázs Orbán
6f9ca4143d fix: detect origin when instanceof Request check fails (#7303) 2023-04-18 17:46:49 +01:00
Balázs Orbán
e97b27414a Merge branch 'main' of github.com:nextauthjs/next-auth 2023-04-17 11:41:02 +02:00
Balázs Orbán
9018939ee7 docs: clean up databases intro page
#7221
2023-04-17 11:40:59 +02:00
Raul
c2fc41b44d chore: fix "Contributing guide" link (#7279) 2023-04-17 10:36:23 +01:00
Chris Hayes
01d7eb4feb docs: Remove --save from install command (#7277)
Remove --save from install command

--save is no longer needed on npm install.
2023-04-17 10:35:48 +01:00
Balázs Orbán
2388c20cc6 Merge branch 'main' of github.com:nextauthjs/next-auth 2023-04-17 11:32:26 +02:00
Balázs Orbán
9a1bef9e72 chore: skip adapters in docs dev by default 2023-04-17 11:32:23 +02:00
Balázs Orbán
35a72d2273 chore: update typedoc dependencies 2023-04-17 11:32:09 +02:00
Abdulaziz Askaraliev
5f1b75a7a2 fix(providers): fix type definition and docs for yandex (#7170)
Co-authored-by: Thang Vu <hi@thvu.dev>
2023-04-16 14:47:06 +07:00
Thang Vu
fa58065951 chore: move next-auth from v4 to main (#7265) 2023-04-15 17:02:46 +01:00
Balázs Orbán
b31f2af66c feat: misc improvements (#7228)
* tweak types, fix typos

* filter non-oauth files when generating provider types

* allow implicit config invoke

* remove workaround for multiple cookie settings in Next.js

* feat: return `null` when session does not exist

* error on missing checks when configured
2023-04-12 11:40:55 +01:00
Prana Adiwira
71bb6f2590 fix(providers): Use the proper check for Reddit (#7224)
Reddit expects the `state` parameter

https://github.com/reddit-archive/reddit/wiki/OAuth2#authorization
2023-04-12 11:37:31 +01:00
Balázs Orbán
6c07331cc5 chore: upgrade turbo 2023-04-06 12:58:10 +02:00
Saurav Maheshkar
c8ef94b2be chore: move prettier and eslint configs under package.json (#7145) 2023-04-06 12:57:16 +02:00
jakzo
75a59fbd92 chore(docs): fix dynamodb typo (#7130)
fix: typo
2023-04-06 12:57:09 +02:00
Balázs Orbán
3dd47b0735 docs(example): remove unstable_ prefix 2023-03-31 05:01:58 +02:00
Balázs Orbán
4dc1d421f8 docs: mention client in OAuth config options
Related issue #7114
2023-03-30 18:34:30 +02:00
Balázs Orbán
99ca67f1cf docs: fix typo 2023-03-28 13:59:08 +02:00
Balázs Orbán
a087df8494 docs: fix some links 2023-03-28 13:47:53 +02:00
Sai Srikar Dumpeti
1aa4994de6 docs: respect color scheme (#7076) 2023-03-28 04:06:21 +02:00
Alan Hoskins
88023f69b9 fix(docs): remove extra install (#7081) 2023-03-27 15:47:32 +02:00
Alan Hoskins
b02057a72d fix(docs): fix broken links links (#7083)
Co-authored-by: Alan Hoskins <ahoskins@knowland.com>
2023-03-27 15:46:43 +02:00
Balázs Orbán
400da8c766 fix(providers): mention Email Address as required for Azure B2C
closes #7071
2023-03-27 15:44:23 +02:00
Andres Rodriguez
b48104801b chore(provider): added svg for Reddit (#7050)
Added svg for Reddit

Co-authored-by: Nico Domino <yo@ndo.dev>
2023-03-27 09:36:47 +02:00
Balázs Orbán
ccbbc800d2 docs: rephrase buttons on landing page 2023-03-27 02:06:33 +02:00
Abdulaziz Askaraliev
d7888263ca fix(providers): update Yandex to TypeScript (#7054)
* fix(providers): yandex add typescript.

* fix(providers): yandex add avatar to scope

* fix(providers): Yandex - add types & avatar scope

* fix(providers): Yandex - permissions list

* Apply suggestions from code review

* Apply suggestions from code review

* docs(provider): added comments for

* revert yandex.ts from next-auth/providers/

* fix(providers): yandex fix typo

* revert

* Update [...nextauth].ts

* Update yandex.ts

* Update yandex.ts

* Update [...nextauth].ts

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-03-27 00:38:06 +01:00
Balázs Orbán
47d3151410 Merge branch 'main' of github.com:nextauthjs/next-auth 2023-03-27 01:32:54 +02:00
Balázs Orbán
7d264860ab chore: package builds as docs#dev task dependencies 2023-03-27 01:32:50 +02:00
Abdulaziz Askaraliev
6184b936f5 chore(docs): show close button on announcementBar (#7074)
* fix #6935: show close button.

* fix(global-css): show close button on annoucement bar

dev and build were generating different results, adding `!important` fixed on build.
2023-03-26 21:48:36 +02:00
Balázs Orbán
1954258a0a docs: make security page top-level 2023-03-26 03:46:51 +02:00
Jabed Zaman
c580f0db22 docs: fix session.user is possibly undefined. (#7058)
fixed the code snippet for the example to consume session via hooks. Threw an error earlier stating 'session.user' is possibly 'undefined'.
2023-03-25 20:15:38 +00:00
Balázs Orbán
d1cf701ed9 docs: change admonition titles 2023-03-24 12:46:02 +01:00
Balázs Orbán
69398e2d3a docs: clarify guides overview 2023-03-24 12:43:56 +01:00
Balázs Orbán
856b5c50fc docs: change section title 2023-03-24 12:43:40 +01:00
Balázs Orbán
2830b7de5b docs: fix some typos 2023-03-24 12:43:23 +01:00
Balázs Orbán
40a0faa586 docs: remove outdated guides 2023-03-24 12:43:08 +01:00
Balázs Orbán
a6b4d958ac docs: open basics guides by default 2023-03-24 12:42:52 +01:00
Balázs Orbán
cc13df9d51 docs: tweak announcement bar 2023-03-24 12:42:41 +01:00
Balázs Orbán
06b8d4772c docs: simplify 2023-03-24 03:44:59 +01:00
Balázs Orbán
d644d1fcbf docs: add sidebar to API reference 2023-03-24 03:43:15 +01:00
Balázs Orbán
380f2de961 docs: add API reference overview 2023-03-24 03:29:29 +01:00
Nikhil Dev Chunchu
dc5f3e1873 chore(docs): update using-a-database-adapter.md (#7028)
Update using-a-database-adapter.md
2023-03-22 09:30:56 +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
840 changed files with 38909 additions and 32084 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 +0,0 @@
// @ts-check
/** @type {import("eslint").ESLint.ConfigData} */
module.exports = {
env: { browser: true, es2022: true, node: true },
extends: ["eslint:recommended", "prettier"],
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",
],
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/method-signature-style": "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",
},
},
{
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 },
],
"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 },
},
root: true,
}

33
.github/DISCUSSION_TEMPLATE/ideas.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
body:
- type: textarea
attributes:
label: Goals
description: Short list of what the feature request aims to address?
value: |
1.
2.
3.
validations:
required: true
- type: textarea
attributes:
label: Non-Goals
description: Short list of what the feature request _does not_ aim to address?
value: |
1.
2.
3.
validations:
required: false
- type: textarea
attributes:
label: Background
description: Discuss prior art, why do you think this feature is needed? Are there current alternatives?
validations:
required: true
- type: textarea
attributes:
label: Proposal
description: How should this feature be implemented? Are you interested in contributing?
validations:
required: true

View File

@@ -0,0 +1,20 @@
body:
- type: textarea
attributes:
label: Summary
description: What do you need help with?
validations:
required: true
- type: textarea
attributes:
label: Additional information
description: Any code snippets, error messages, or dependency details that may be related?
render: js
validations:
required: false
- type: input
attributes:
label: Example
description: A link to a minimal reproduction is helpful for collaborative debugging!
validations:
required: false

View File

@@ -1,6 +1,6 @@
name: Bug report
description: Report an issue so we can improve
labels: [triage]
labels: [triage, bug]
body:
- type: markdown
attributes:
@@ -11,7 +11,7 @@ body:
### Important :exclamation:
_Providing incorrect/insufficient information or skipping steps to reproduce the issue may result in closing the issue or converting to a discussion without further explanation._
_Providing incorrect/insufficient information or skipping steps to reproduce the issue will result in closing the issue and/or converting to a discussion without further explanation._
If you have a generic question specific to your project, it is best asked in Discussions under the [Questions category](https://github.com/nextauthjs/next-auth/discussions/new?category=Questions)
# Let's wait with this until adoption in other frameworks.
@@ -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

@@ -1,6 +1,6 @@
name: Bug report (Provider)
description: Create a provider-specific report
labels: [triage, providers]
labels: [triage, bug, providers]
body:
- type: markdown
attributes:
@@ -25,17 +25,23 @@ body:
- "Custom provider"
- "42 School"
- "Apple"
- "Asgardeo"
- "Atlassian"
- "Auth0"
- "Authentik"
- "Azure Active Directory"
- "Azure Active Directory B2C"
- "Azure DevOps"
- "Battlenet"
- "Beyond Identity"
- "Box"
- "Bungie"
- "ClickUp"
- "Cognito"
- "Coinbase"
- "Descope"
- "Discord"
- "Dribbble"
- "Dropbox"
- "EVE Online"
- "Facebook"
@@ -54,9 +60,11 @@ body:
- "LinkedIn"
- "Mailchimp"
- "Mail.ru"
- "Mastodon"
- "Medium"
- "Naver"
- "Netlify"
- "Notion"
- "Okta"
- "OneLogin"
- "Osso"
@@ -68,6 +76,7 @@ body:
- "Slack"
- "Spotify"
- "Strava"
- "Tiktok"
- "Todoist"
- "Trakt"
- "Twitch"
@@ -87,7 +96,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

@@ -1,6 +1,6 @@
name: Bug report (Adapter)
description: Create an adapter-specific report
labels: [triage, adapters]
labels: [triage, bug, adapters]
body:
- type: markdown
attributes:
@@ -21,20 +21,26 @@ body:
multiple: true
options:
- "Custom adapter"
- "@next-auth/dgraph-adapter"
- "@next-auth/dynamodb-adapter"
- "@next-auth/fauna-adapter"
- "@next-auth/firebase-adapter"
- "@next-auth/mikro-orm-adapter"
- "@next-auth/mongodb-adapter"
- "@next-auth/neo4j-adapter"
- "@next-auth/pouchdb-adapter"
- "@next-auth/prisma-adapter"
- "@next-auth/sequelize-adapter"
- "@next-auth/supabase-adapter"
- "@next-auth/typeorm-legacy-adapter"
- "@next-auth/upstash-redis-adapter"
- "@next-auth/xata-adapter"
- "@auth/azure-tables-adapter"
- "@auth/edgedb-adapter"
- "@auth/d1-adapter"
- "@auth/dgraph-adapter"
- "@auth/drizzle-adapter"
- "@auth/dynamodb-adapter"
- "@auth/fauna-adapter"
- "@auth/firebase-adapter"
- "@auth/kysely-adapter"
- "@auth/mikro-orm-adapter"
- "@auth/mongodb-adapter"
- "@auth/neo4j-adapter"
- "@auth/pg-adapter"
- "@auth/pouchdb-adapter"
- "@auth/prisma-adapter"
- "@auth/sequelize-adapter"
- "@auth/supabase-adapter"
- "@auth/typeorm-adapter"
- "@auth/upstash-redis-adapter"
- "@auth/xata-adapter"
validations:
required: true
- type: textarea
@@ -44,7 +50,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

@@ -1,72 +0,0 @@
name: Feature Request
description: Suggest an idea for NextAuth.js
labels: [triage, enhancement]
# note: markdown sections will NOT appear as part of the issue as per documentation, rather they provide context to the user
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#markdown
body:
- type: markdown
attributes:
value: |
**NOTE:** Issues that are potentially security related should be reported to us by following the [Security guidelines](https://next-auth.js.org/security) rather than on GitHub.
Thank you very much for reaching out to us regarding the awesome feature that you believe should be included in the NextAuth.js library.
_NOTE: Feature requests are converted to [discussions (Ideas 💡)](https://github.com/nextauthjs/next-auth/discussions/categories/ideas). Make sure your idea hasn't been asked yet, and upvote the existing one before opening a new instead._
### Important :exclamation:
Please proceed by providing the following information:
- type: textarea
id: description
attributes:
label: Description 📓
description: Please provide a more in-depth description of the feature proposed.
validations:
required: true
- type: markdown
attributes:
value: |
Make sure you provide plenty of [links]() to external documentation and inline code examples like so:
```js
function myAwesomeNextAuthFeature() {
return 💚
}
```
Take time thinking about what you want to say and help us understand your proposal making sure that this description contains:
- **purpose of the feature**
- **potential problems**
- **potential alternatives**
- type: textarea
id: reproduction
attributes:
label: How to reproduce ☕️
description: If you have a CodeSandbox playground or some code snippets to help us visualize your idea better, please provide it here.
validations:
required: true
- type: markdown
attributes:
value: |
You can use one of the templates set up on **CodeSandbox** to better illustrate your idea:
- [`next-auth-example`](https://codesandbox.io/s/next-auth-example-1kktb)
- type: dropdown
id: pr
attributes:
label: Contributing 🙌🏽
multiple: false
options:
- "Yes, I am willing to help implement this feature in a PR"
- "No, I am afraid I cannot help regarding this"
validations:
required: true
- type: markdown
attributes:
value: |
It takes a lot of work 🏋🏻‍♀️ maintaining a library like `next-auth`; any contribution is more than welcome 💚

View File

@@ -1,57 +0,0 @@
name: TypeScript
description: Ask a question about NextAuth.js TypeScript integration
labels: [question, TypeScript]
assignees: [lluia, balazsorban44]
# note: markdown sections will NOT appear as part of the issue as per documentation, rather they provide context to the user
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#markdown
body:
- type: textarea
id: question
attributes:
label: Question 💬
description: Please provide an in-depth description of the question you have when using NextAuth.js on a Typescript project or when consuming the built-in types for `next-auth`.
validations:
required: true
- type: markdown
attributes:
value: |
**NOTE:** Issues that are potentially security related should be reported to us by following the [Security guidelines](https://next-auth.js.org/security) rather than on GitHub.
Make sure you [link]() to external documentation if necessary and provide inline code examples like so:
```js
function myAwesomeNextAuthFeature() {
return 💚
}
```
**NOTE:** Questions will be converted to Discussions. You can find them [here](https://github.com/nextauthjs/next-auth/discussions)!
- type: textarea
id: codesandbox
attributes:
label: How to reproduce ☕️
description: Please provide a link to a minimal reproduction or code snippets that represents your question
validations:
required: true
- type: markdown
attributes:
value: |
We encourage you to use the template set-up on **CodeSandbox** as a playground to represent your question or doubt:
- [`next-auth-example`](https://codesandbox.io/s/next-auth-example-1kktb)
- type: dropdown
id: pr
attributes:
label: Contributing 🙌🏽
multiple: false
options:
- "Yes, I am willing to help answer this question in a PR"
- "No, I am afraid I cannot help regarding this"
validations:
required: true
- type: markdown
attributes:
value: |
It takes a lot of work 🏋🏻‍♀️ maintaining a library like `next-auth`; any contribution is more than welcome 💚

View File

@@ -1,61 +0,0 @@
name: Question
description: Ask a question about NextAuth.js or for help using it
labels: [question]
# note: markdown sections will NOT appear as part of the issue as per documentation, rather they provide context to the user
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#markdown
body:
- type: markdown
attributes:
value: |
**NOTE:** Issues that are potentially security related should be reported to us by following the [Security guidelines](https://next-auth.js.org/security) rather than on GitHub.
We are glad that you have a question about this library. Please provide the following information:
- type: textarea
id: question
attributes:
label: Question 💬
description: Please provide an in-depth description of the question you have.
validations:
required: true
- type: markdown
attributes:
value: |
Make sure you [link]() to external documentation if necessary and provide inline code examples like so:
```js
function myAwesomeNextAuthFeature() {
return 💚
}
```
**NOTE:** Questions will be converted to Discussions. You can find them [here](https://github.com/nextauthjs/next-auth/discussions)!
- type: textarea
id: reproduction
attributes:
label: How to reproduce ☕️
description: Please provide a link to a minimal reproduction or code snippets that represents your question
validations:
required: true
- type: markdown
attributes:
value: |
We encourage you to use the template set-up on **CodeSandbox** as a playground to represent your question or doubt:
- [`next-auth-example`](https://codesandbox.io/s/next-auth-example-1kktb)
- type: dropdown
id: pr
attributes:
label: Contributing 🙌🏽
multiple: false
options:
- "Yes, I am willing to help answer this question in a PR"
- "No, I am afraid I cannot help regarding this"
validations:
required: true
- type: markdown
attributes:
value: |
It takes a lot of work 🏋🏻‍♀️ maintaining a library like `next-auth`; any contribution is more than welcome 💚

View File

@@ -1 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/nextauthjs/next-auth/discussions/new?category=questions
about: Ask questions and discuss with other community members
- name: Feature request
url: https://github.com/nextauthjs/next-auth/discussions/new?category=ideas
about: Feature requests should be opened as discussions

View File

@@ -1,2 +0,0 @@
!dist
!package-lock.json

File diff suppressed because one or more lines are too long

View File

@@ -1,653 +0,0 @@
@actions/core
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
@actions/github
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
@actions/http-client
MIT
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
@octokit/auth-token
MIT
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
@octokit/core
MIT
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
@octokit/endpoint
MIT
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
@octokit/graphql
MIT
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
@octokit/plugin-paginate-rest
MIT
MIT License Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
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.
@octokit/plugin-rest-endpoint-methods
MIT
MIT License Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
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.
@octokit/request
MIT
The MIT License
Copyright (c) 2018 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
@octokit/request-error
MIT
The MIT License
Copyright (c) 2019 Octokit contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
@vercel/ncc
MIT
Copyright 2018 ZEIT, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
before-after-hook
Apache-2.0
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2018 Gregor Martynus and other contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
deprecation
ISC
The ISC License
Copyright (c) Gregor Martynus and contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
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.
is-plain-object
MIT
The MIT License (MIT)
Copyright (c) 2014-2017, Jon Schlinkert.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
node-fetch
MIT
The MIT License (MIT)
Copyright (c) 2016 David Frank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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.
once
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
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.
root
ISC License
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
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
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.
tr46
MIT
tunnel
MIT
The MIT License (MIT)
Copyright (c) 2012 Koichi Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
universal-user-agent
ISC
# [ISC License](https://spdx.org/licenses/ISC)
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 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.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.
webidl-conversions
BSD-2-Clause
# The BSD 2-Clause License
Copyright (c) 2014, Domenic Denicola
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
whatwg-url
MIT
The MIT License (MIT)
Copyright (c) 20152016 Sebastian Mayr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
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.
wrappy
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
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.

View File

@@ -1,445 +0,0 @@
{
"name": "issue-validator",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"@actions/core": "1.10.0",
"@actions/github": "5.1.1"
},
"devDependencies": {
"@vercel/ncc": "0.34.0"
}
},
"node_modules/@actions/core": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"dependencies": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"node_modules/@actions/github": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
"integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
"dependencies": {
"@actions/http-client": "^2.0.1",
"@octokit/core": "^3.6.0",
"@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
}
},
"node_modules/@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"dependencies": {
"tunnel": "^0.0.6"
}
},
"node_modules/@octokit/auth-token": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
"integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==",
"dependencies": {
"@octokit/types": "^6.0.3"
}
},
"node_modules/@octokit/core": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
"dependencies": {
"@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.3",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/endpoint": {
"version": "6.0.12",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz",
"integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==",
"dependencies": {
"@octokit/types": "^6.0.3",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/graphql": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz",
"integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==",
"dependencies": {
"@octokit/request": "^5.6.0",
"@octokit/types": "^6.0.3",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/openapi-types": {
"version": "12.10.1",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.10.1.tgz",
"integrity": "sha512-P+SukKanjFY0ZhsK6wSVnQmxTP2eVPPE8OPSNuxaMYtgVzwJZgfGdwlYjf4RlRU4vLEw4ts2fsE2icG4nZ5ddQ=="
},
"node_modules/@octokit/plugin-paginate-rest": {
"version": "2.21.3",
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz",
"integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==",
"dependencies": {
"@octokit/types": "^6.40.0"
},
"peerDependencies": {
"@octokit/core": ">=2"
}
},
"node_modules/@octokit/plugin-rest-endpoint-methods": {
"version": "5.16.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz",
"integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==",
"dependencies": {
"@octokit/types": "^6.39.0",
"deprecation": "^2.3.1"
},
"peerDependencies": {
"@octokit/core": ">=3"
}
},
"node_modules/@octokit/request": {
"version": "5.6.3",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
"integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
"dependencies": {
"@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.1.0",
"@octokit/types": "^6.16.1",
"is-plain-object": "^5.0.0",
"node-fetch": "^2.6.7",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/request-error": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
"integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==",
"dependencies": {
"@octokit/types": "^6.0.3",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
},
"node_modules/@octokit/types": {
"version": "6.40.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.40.0.tgz",
"integrity": "sha512-MFZOU5r8SwgJWDMhrLUSvyJPtVsqA6VnbVI3TNbsmw+Jnvrktzvq2fYES/6RiJA/5Ykdwq4mJmtlYUfW7CGjmw==",
"dependencies": {
"@octokit/openapi-types": "^12.10.0"
}
},
"node_modules/@vercel/ncc": {
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
"dev": true,
"bin": {
"ncc": "dist/ncc/cli.js"
}
},
"node_modules/before-after-hook": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
},
"node_modules/deprecation": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
},
"node_modules/is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
"node_modules/tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"node_modules/universal-user-agent": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
},
"node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}
},
"dependencies": {
"@actions/core": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"requires": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"@actions/github": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-5.1.1.tgz",
"integrity": "sha512-Nk59rMDoJaV+mHCOJPXuvB1zIbomlKS0dmSIqPGxd0enAXBnOfn4VWF+CGtRCwXZG9Epa54tZA7VIRlJDS8A6g==",
"requires": {
"@actions/http-client": "^2.0.1",
"@octokit/core": "^3.6.0",
"@octokit/plugin-paginate-rest": "^2.17.0",
"@octokit/plugin-rest-endpoint-methods": "^5.13.0"
}
},
"@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": {
"tunnel": "^0.0.6"
}
},
"@octokit/auth-token": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
"integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==",
"requires": {
"@octokit/types": "^6.0.3"
}
},
"@octokit/core": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz",
"integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==",
"requires": {
"@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.3",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/endpoint": {
"version": "6.0.12",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz",
"integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==",
"requires": {
"@octokit/types": "^6.0.3",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/graphql": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz",
"integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==",
"requires": {
"@octokit/request": "^5.6.0",
"@octokit/types": "^6.0.3",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/openapi-types": {
"version": "12.10.1",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-12.10.1.tgz",
"integrity": "sha512-P+SukKanjFY0ZhsK6wSVnQmxTP2eVPPE8OPSNuxaMYtgVzwJZgfGdwlYjf4RlRU4vLEw4ts2fsE2icG4nZ5ddQ=="
},
"@octokit/plugin-paginate-rest": {
"version": "2.21.3",
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz",
"integrity": "sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==",
"requires": {
"@octokit/types": "^6.40.0"
}
},
"@octokit/plugin-rest-endpoint-methods": {
"version": "5.16.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz",
"integrity": "sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==",
"requires": {
"@octokit/types": "^6.39.0",
"deprecation": "^2.3.1"
}
},
"@octokit/request": {
"version": "5.6.3",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz",
"integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==",
"requires": {
"@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.1.0",
"@octokit/types": "^6.16.1",
"is-plain-object": "^5.0.0",
"node-fetch": "^2.6.7",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/request-error": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
"integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==",
"requires": {
"@octokit/types": "^6.0.3",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
},
"@octokit/types": {
"version": "6.40.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.40.0.tgz",
"integrity": "sha512-MFZOU5r8SwgJWDMhrLUSvyJPtVsqA6VnbVI3TNbsmw+Jnvrktzvq2fYES/6RiJA/5Ykdwq4mJmtlYUfW7CGjmw==",
"requires": {
"@octokit/openapi-types": "^12.10.0"
}
},
"@vercel/ncc": {
"version": "0.34.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.34.0.tgz",
"integrity": "sha512-G9h5ZLBJ/V57Ou9vz5hI8pda/YQX5HQszCs3AmIus3XzsmRn/0Ptic5otD3xVST8QLKk7AMk7AqpsyQGN7MZ9A==",
"dev": true
},
"before-after-hook": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
},
"deprecation": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
},
"is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
},
"node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"requires": {
"whatwg-url": "^5.0.0"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"requires": {
"wrappy": "1"
}
},
"tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
},
"tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
},
"universal-user-agent": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
},
"webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
},
"whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
"requires": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}
}
}

View File

@@ -1,14 +0,0 @@
{
"private": true,
"exports": "./index.mjs",
"scripts": {
"build": "ncc -m -o . build src/index.mjs --license licenses.txt"
},
"devDependencies": {
"@vercel/ncc": "0.34.0"
},
"dependencies": {
"@actions/core": "1.10.0",
"@actions/github": "5.1.1"
}
}

View File

@@ -1,37 +0,0 @@
We cannot recreate the issue with the provided information. **Please add a reproduction in order for us to be able to investigate.**
### **Why was this issue marked with the `incomplete` label?**
To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository ([template](https://github.com/nextauthjs/next-auth-example)), but you can also use a tool like [CodeSandbox](https://codesandbox.io/s/github/nextauthjs/next-auth-example/tree/main) or [StackBlitz](https://stackblitz.com/fork/github/nextauthjs/next-auth-example).
To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as **minimal** as possible. This means that you should **remove unnecessary code, files, and dependencies** that do not contribute to the issue.
Please test your reproduction against the latest version of NextAuth.js (`next-auth@latest`) to make sure your issue has not already been fixed.
### **I added a link, why was it still marked?**
Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "[example.com](http://example.com/)", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.
### **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.
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.
### **I did not open this issue, but it is relevant to me, what can I do to help?**
Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please **do not** comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.
### **I think my reproduction is good enough, why aren't you looking into it quicker?**
We look into every NextAuth.js issue and constantly monitor open issues for new comments.
However, sometimes we might miss one or two. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.
Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.
### **Useful Resources**
- [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

@@ -1,95 +0,0 @@
// @ts-check
// @ts-expect-error
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"
/**
* @typedef {{
* id :number
* node_id :string
* url :string
* name :string
* description :string
* color :string
* default :boolean
* }} Label
*
* @typedef {{
* pull_request: any
* issue?: {body: string, number: number, labels: Label[]}
* label: Label
* }} Payload
*
* @typedef {{
* payload: Payload
* repo: any
* }} Context
*/
async function run() {
try {
/** @type {Context} */
const { payload, repo } = github.context
const {
issue,
pull_request,
label: { name: newLabel },
} = payload
if (
pull_request ||
!issue?.body ||
!process.env.GITHUB_TOKEN ||
!process.env.GITHUB_ACTION_PATH
)
return
const labels = issue.labels.map((l) => l.name)
// const isBugReport =
// labels.includes(bugLabel) || newLabel === bugLabel || !labels.length
if (
// !(isBugReport && issue.number > 43554) &&
![addReproductionLabel].includes(newLabel) &&
!labels.includes(addReproductionLabel)
) {
return core.info(
"Not a bug report or not manually labeled or already labeled."
)
}
const client = github.getOctokit(process.env.GITHUB_TOKEN).rest
const issueCommon = { ...repo, issue_number: issue.number }
if (
newLabel === addReproductionLabel
// || !hasValidRepro
) {
await Promise.all([
client.issues.addLabels({
...issueCommon,
labels: [addReproductionLabel],
}),
client.issues.createComment({
...issueCommon,
body: readFileSync(
join(process.env.GITHUB_ACTION_PATH, "repro.md"),
"utf8"
),
}),
])
return core.info(
"Commented on issue, because it did not have a sufficient reproduction."
)
}
} catch (error) {
core.setFailed(error.message)
}
}
run()

51
.github/invalid-reproduction.md vendored Normal file
View File

@@ -0,0 +1,51 @@
We could not detect a valid reproduction link. **Make sure to follow the bug report template carefully.**
### Why was this issue closed?
To be able to investigate, we need access to a reproduction to identify what triggered the issue. We need a link to a **public** GitHub repository. Example: ([NextAuth.js example repository](https://github.com/nextauthjs/next-auth-example)).
The bug template that you filled out has a section called "Reproduction URL", which is where you should provide the link to the reproduction.
- If you did not provide a link or the link you provided is not valid, we will close the issue.
- If you provide a link to a private repository, we will close the issue.
- If you provide a link to a repository but not in the correct section, we will close the issue.
### What should I do?
Depending on the reason the issue was closed, you can do the following:
- If you did not provide a link, please open a new issue with a link to a reproduction.
- If you provided a link to a private repository, please open a new issue with a link to a public repository.
- If you provided a link to a repository but not in the correct section, please open a new issue with a link to a reproduction in the correct section.
**In general, assume that we should not go through a lengthy onboarding process at your company code only to be able to verify an issue.**
### My repository is private and cannot make it public
In most cases, a private repo will not be a sufficient **minimal reproduction**, as this codebase might contain a lot of unrelated parts that would make our investigation take longer. Please do **not** make it public. Instead, create a new repository using the templates above, adding the relevant code to reproduce the issue. Common things to look out for:
- Remove any code that is not related to the issue. (pages, API Routes, components, etc.)
- Remove any dependencies that are not related to the issue.
- Remove any third-party service that would require us to sign up for an account to reproduce the issue.
- Remove any environment variables that are not related to the issue.
- Remove private packages that we do not have access to.
- If the issue is not related to a monorepo specifically, try to reproduce the issue without a complex monorepo setup
### I did not open this issue, but it is relevant to me, what can I do to help?
Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps by opening a new issue.
### I think my reproduction is good enough, why aren't you looking into it quickly?
We look into every issue and monitor open issues for new comments.
However, sometimes we might miss a few due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.
Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.
### Useful Resources
- [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve)
- [Bug report: Framework](https://github.com/nextauthjs/next-auth/issues/new?assignees=&labels=triage&projects=&template=1_bug_framework.yml)
- [Bug report: Provider](https://github.com/nextauthjs/next-auth/issues/new?assignees=&labels=triage%2Cproviders&projects=&template=2_bug_provider.yml)
- [Bug report: Adapter](https://github.com/nextauthjs/next-auth/issues/new?assignees=&labels=triage%2Cadapters&projects=&template=3_bug_adapter.yml)

View File

@@ -1,43 +0,0 @@
# https://github.com/github/issue-labeler#basic-examples
dgraph:
- "@next-auth/dgraph-adapter"
dynamodb:
- "@next-auth/dynamodb-adapter"
fauna:
- "@next-auth/fauna-adapter"
firebase:
- "@next-auth/firebase-adapter"
mikro-orm:
- "@next-auth/mikro-orm-adapter"
mongodb:
- "@next-auth/mongodb-adapter"
neo4j:
- "@next-auth/neo4j-adapter"
pouchdb:
- "@next-auth/pouchdb-adapter"
prisma:
- "@next-auth/prisma-adapter"
sequelize:
- "@next-auth/sequelize-adapter"
supabase:
- "@next-auth/supabase-adapter"
typeorm-legacy:
- "@next-auth/typeorm-legacy-adapter"
upstash-redis:
- "@next-auth/upstash-redis-adapter"
xata:
- "@next-auth/xata-adapter"

View File

@@ -1,7 +1,11 @@
# https://github.com/actions/labeler#create-githublabeleryml
adapters: ["packages/core/src/adapters.ts", "packages/adapter-*/**/*"]
core: ["packages/core/src/**/*"]
azure-tables: ["packages/adapter-azure-tables/**/*"]
edgedb: ["packages/adapter-edgedb/**/*"]
d1: ["packages/adapter-d1/**/*"]
dgraph: ["packages/adapter-dgraph/**/*"]
drizzle: ["packages/adapter-drizzle/**/*"]
documentation: ["packages/docs/docs/**/*"]
dynamodb: ["packages/adapter-dynamodb/**/*"]
examples: ["apps/examples/**/*"]
@@ -12,15 +16,18 @@ legacy: ["packages/next-auth/**/*"]
mikro-orm: ["packages/adapter-mikro-orm/**/*"]
mongodb: ["packages/adapter-mongodb/**/*"]
neo4j: ["packages/adapter-neo4j/**/*"]
pg: ["packages/adapter-pg/**/*"]
playgrounds: ["apps/playgrounds/**/*"]
pouchdb: ["packages/adapter-pouchdb/**/*"]
prisma: ["packages/adapter-prisma/**/*"]
kysely: ["packages/adapter-kysely/**/*"]
providers: ["packages/core/src/providers/**/*"]
sequelize: ["packages/adapter-sequelize/**/*"]
solidjs: ["packages/frameworks-solid-start/**/*"]
supabase: ["packages/adapter-supabase/**/*"]
surrealdb: ["packages/adapter-surrealdb/**/*"]
svelte: ["packages/frameworks-sveltekit/**/*"]
test: ["**test**/*"]
typeorm-legacy: ["packages/adapter-typeorm-legacy/**/*"]
typeorm: ["packages/adapter-typeorm/**/*"]
upstash-redis: ["packages/adapter-upstash-redis/**/*"]
xata: ["packages/adapter-xata/**/*"]

24
.github/sync.yml vendored
View File

@@ -1,5 +1,3 @@
# Note that nextauthjs/next-auth-example syncs from the v4 branch
nextauthjs/sveltekit-auth-example:
- source: apps/examples/sveltekit
dest: .
@@ -7,15 +5,12 @@ nextauthjs/sveltekit-auth-example:
- .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/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
@@ -23,3 +18,10 @@ nextauthjs/next-auth-gatsby-example:
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE
nextauthjs/next-auth-example:
- source: apps/examples/nextjs
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE

View File

@@ -5,14 +5,15 @@ const core = require("@actions/core")
try {
const packageJSONPath = path.join(
process.cwd(),
"packages/next-auth/package.json"
`packages/${process.env.PACKAGE_PATH || "next-auth"}/package.json`
)
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, "utf8"))
const sha8 = process.env.GITHUB_SHA.substring(0, 8)
const prNumber = process.env.PR_NUMBER
const packageVersion = `0.0.0-pr.${prNumber}.${sha8}`
const prefix = "0.0.0-"
const pr = process.env.PR_NUMBER
const source = pr ? `pr.${pr}` : "manual"
const packageVersion = `${prefix}${source}.${sha8}`
packageJSON.version = packageVersion
core.setOutput("version", packageVersion)
fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON))

View File

@@ -1,18 +0,0 @@
# https://github.com/github/issue-labeler#create-workflow
name: Label issues
on:
issues:
types: [opened]
jobs:
triage:
name: Triage
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v2.5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: ".github/issue-labeler.yml"
enable-versioned-regex: 0

View File

@@ -1,17 +0,0 @@
name: Validate issue
on:
issues:
types: [labeled]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,11 +3,63 @@ name: Release
on:
push:
branches:
- "main"
- "beta"
- "next"
- "3.x"
- main
- beta
- next
- 3.x
pull_request:
# TODO: Support latest releases
workflow_dispatch:
inputs:
name:
type: choice
description: Package name (npm)
options:
- "@auth/core"
- "@auth/dgraph-adapter"
- "@auth/drizzle-adapter"
- "@auth/dynamodb-adapter"
- "@auth/fauna-adapter"
- "@auth/firebase-adapter"
- "@auth/mikro-orm-adapter"
- "@auth/mongodb-adapter"
- "@auth/neo4j-adapter"
- "@auth/pouchdb-adapter"
- "@auth/prisma-adapter"
- "@auth/sequelize-adapter"
- "@auth/supabase-adapter"
- "@auth/typeorm-adapter"
- "@auth/upstash-redis-adapter"
- "@auth/xata-adapter"
- "next-auth"
# TODO: Infer from package name
path:
type: choice
description: Directory name (packages/*)
options:
- "core"
- "frameworks-nextjs"
- "adapter-edgedb"
- "adapter-dgraph"
- "adapter-drizzle"
- "adapter-dynamodb"
- "adapter-fauna"
- "adapter-firebase"
- "adapter-mikro-orm"
- "adapter-mongodb"
- "adapter-neo4j"
- "adapter-pouchdb"
- "adapter-prisma"
- "adapter-sequelize"
- "adapter-supabase"
- "adapter-typeorm"
- "adapter-upstash-redis"
- "adapter-xata"
- "next-auth"
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
FORCE_COLOR: true
jobs:
test:
@@ -27,14 +79,30 @@ jobs:
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- 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: ${{ vars.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:
@@ -109,3 +177,36 @@ jobs:
env:
VERSION: ${{ steps.determine-version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
release-manual:
name: Publish manually
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' }}
steps:
- name: Init
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Determine version
uses: ./.github/version-pr
id: determine-version
env:
PACKAGE_PATH: ${{ github.event.inputs.path }}
- name: Publish to npm
run: |
pnpm build
cd packages/$PACKAGE_PATH
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
pnpm publish --no-git-checks --access public --tag experimental
echo "🎉 Experimental release published 📦️ on npm: https://npmjs.com/package/${{ github.event.inputs.name }}/v/${{ env.VERSION }}"
echo "Install via: pnpm add ${{ github.event.inputs.name }}@${{ env.VERSION }}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PACKAGE_PATH: ${{ github.event.inputs.path }}
VERSION: ${{ steps.determine-version.outputs.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.GH_PAT_CLASSIC }}
GH_PAT: ${{ secrets.GH_PAT }}
IS_FINE_GRAINED: true
SKIP_PR: true
ORIGINAL_MESSAGE: true

24
.github/workflows/triage.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Triage issue
on:
issues:
types: [labeled, opened]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
issues: write
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Nissuer
uses: balazsorban44/nissuer@1.5.0
with:
label-area-prefix: ""
label-area-section: "[Provider|Adapter] type(.*)### Environment"
label-comments: '{ "incomplete": ".github/invalid-reproduction.md" }'
reproduction-link-section: "### Reproduction URL(.*)### Describe the issue"
reproduction-invalid-label: "invalid reproduction"
reproduction-issue-labels: "bug"

32
.gitignore vendored
View File

@@ -1,19 +1,21 @@
# Misc
.DS_Store
.npmrc
.eslintcache
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
packages/*/.npmrc
npm-debug.log*
yarn-debug.log*
yarn-error.log*
firebase-debug.log
ui-debug.log
.pnpm-debug.log
.husky
# Dependencies
node_modules
@@ -34,18 +36,17 @@ 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
packages/*/lib
# Development app
apps/dev/src/css
apps/dev/prisma/migrations
apps/dev/typeorm
apps/dev/nextjs-2
# VS
/.vs/slnx.sqlite-journal
@@ -66,6 +67,7 @@ packages/adapter-prisma/prisma/dev.db
packages/adapter-prisma/prisma/migrations
db.sqlite
packages/adapter-supabase/supabase/.branches
packages/adapter-drizzle/.drizzle
# Tests
coverage
@@ -81,14 +83,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
packages/core/src/lib/pages/styles.ts
docs/docs/reference/03-core
docs/docs/reference/04-sveltekit
docs/docs/reference/core
docs/docs/reference/sveltekit
# SvelteKit
@@ -98,3 +98,9 @@ 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
## Drizzle migration folder
.drizzle

1
.npmrc Normal file
View File

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

View File

@@ -20,8 +20,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
docs/providers.json

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 +0,0 @@
packages/next-auth/README.md

153
README.md Normal file
View File

@@ -0,0 +1,153 @@
<p align="center">
<br/>
<a href="https://authjs.dev" target="_blank"><img width="96px" src="https://authjs.dev/img/logo/logo-sm.png" /></a>
<h3 align="center">Auth.js</h3>
<p align="center">Authentication for the Web.</p>
<p align="center">Open Source. Full Stack. Own Your Data.</p>
<p align="center" style="align: center;">
<a href="https://npm.im/@auth/prisma-adapter">
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
</a>
<a href="https://www.npmtrends.com/next-auth">
<img src="https://img.shields.io/npm/dm/next-auth?style=flat-square" alt="Downloads" />
</a>
<a href="https://github.com/nextauthjs/next-auth/stargazers">
<img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square" alt="Github Stars" />
</a>
<a href="https://www.npmjs.com/package/next-auth">
<img src="https://img.shields.io/github/v/release/nextauthjs/next-auth?label=latest&style=flat-square" alt="Github Stable Release" />
</a>
</p>
</p>
Auth.js is a set of open-source packages that are built on Web Standard APIs for authentication in modern applications with any framework on any platform in any JS runtime.
See [authjs.dev](https://authjs.dev) for our framework-specific libraries, or check out [next-auth.js.org](https://next-auth.js.org) for `next-auth` (Next.js).
## Features
### Flexible and easy to use
- Designed to work with any OAuth service, it supports 2.0+, OIDC
- Built-in support for [many popular sign-in services](https://github.com/nextauthjs/next-auth/tree/main/packages/core/src/providers)
- Email/Passwordless authentication
- Bring Your Database - or none! - stateless authentication with any backend (Active Directory, LDAP, etc.)
- Runtime-agnostic, runs anywhere! (Vercel Edge Functions, Node.js, Serverless, etc.)
### Own your data
Auth.js can be used with or without a database.
- An open-source solution that allows you to keep control of your data
- Built-in support for [MySQL, MariaDB, Postgres, Microsoft SQL Server, MongoDB, SQLite, etc.](https://adapters.authjs.dev)
- Works great with databases from popular hosting providers
### Secure by default
- Promotes the use of passwordless sign-in mechanisms
- Designed to be secure by default and encourage best practices for safeguarding user data
- Uses Cross-Site Request Forgery (CSRF) Tokens on POST routes (sign in, sign out)
- Default cookie policy aims for the most restrictive policy appropriate for each cookie
- When JSON Web Tokens are used, they are encrypted by default (JWE) with A256GCM
- Features tab/window syncing and session polling to support short-lived sessions
- Attempts to implement the latest guidance published by [Open Web Application Security Project](https://owasp.org)
Advanced configuration allows you to define your routines to handle controlling what accounts are allowed to sign in, for encoding and decoding JSON Web Tokens and to set custom cookie security policies and session properties, so you can control who can sign in and how often sessions have to be re-validated.
### TypeScript
Auth.js libraries are written with type safety in mind. [Check out the docs](https://authjs.dev/getting-started/typescript) for more information.
## Security
If you think you have found a vulnerability (or are not sure) in Auth.js or any of the related packages (i.e. Adapters), we ask you to read our [Security Policy](https://authjs.dev/security) to reach out responsibly. Please do not open Pull Requests/Issues/Discussions before consulting with us.
## Acknowledgments
[Auth.js is made possible thanks to all of its contributors.](https://authjs.dev/contributors)
<a href="https://github.com/nextauthjs/next-auth/graphs/contributors">
<img width="500px" src="https://contrib.rocks/image?repo=nextauthjs/next-auth" />
</a>
<div>
<a href="https://vercel.com?utm_source=nextauthjs&utm_campaign=oss"></a>
</div>
### Support
We have an [OpenCollective](https://opencollective.com/nextauth) for individuals and companies looking to contribute financially to the project!
<!--sponsors start-->
<table>
<tbody>
<tr>
<td align="center" valign="top">
<a href="https://vercel.com" target="_blank">
<img width="128px" src="https://avatars.githubusercontent.com/u/14985020?v=4" alt="Vercel Logo" />
</a><br />
<div>Vercel</div><br />
<sub>🥉 Bronze Financial Sponsor <br /> ☁️ Infrastructure Support</sub>
</td>
<td align="center" valign="top">
<a href="https://prisma.io" target="_blank">
<img width="128px" src="https://avatars.githubusercontent.com/u/17219288?v=4" alt="Prisma Logo" />
</a><br />
<div>Prisma</div><br />
<sub>🥉 Bronze Financial Sponsor</sub>
</td>
<td align="center" valign="top">
<a href="https://clerk.com" target="_blank">
<img width="128px" src="https://avatars.githubusercontent.com/u/49538330?s=200&v=4" alt="Clerk Logo" />
</a><br />
<div>Clerk</div><br />
<sub>🥉 Bronze Financial Sponsor</sub>
</td>
<td align="center" valign="top">
<a href="https://lowdefy.com" target="_blank">
<img width="128px" src="https://avatars.githubusercontent.com/u/47087496?s=200&v=4" alt="Lowdefy Logo" />
</a><br />
<div>Lowdefy</div><br />
<sub>🥉 Bronze Financial Sponsor</sub>
</td>
<td align="center" valign="top">
<a href="https://workos.com" target="_blank">
<img width="128px" src="https://avatars.githubusercontent.com/u/47638084?s=200&v=4" alt="WorkOS Logo" />
</a><br />
<div>WorkOS</div><br />
<sub>🥉 Bronze Financial Sponsor</sub>
</td>
<td align="center" valign="top">
<a href="https://www.descope.com" target="_blank">
<img width="128px" src="https://avatars.githubusercontent.com/u/97479186?v=4" alt="Descope Logo" />
</a><br />
<div>Descope</div><br />
<sub>🥉 Bronze Financial Sponsor</sub>
</td>
<td align="center" valign="top">
<a href="https://checklyhq.com" target="_blank">
<img width="128px" src="https://avatars.githubusercontent.com/u/25982255?v=4" alt="Checkly Logo" />
</a><br />
<div>Checkly</div><br />
<sub>☁️ Infrastructure Support</sub>
</td>
<td align="center" valign="top">
<a href="https://superblog.ai/" target="_blank">
<img width="128px" src="https://d33wubrfki0l68.cloudfront.net/cdc4a3833bd878933fcc131655878dbf226ac1c5/10cd6/images/logo_bolt_small.png" alt="superblog Logo" />
</a><br />
<div>superblog</div><br />
<sub>☁️ Infrastructure Support</sub>
</td>
</tr><tr></tr>
</tbody>
</table>
<br />
<!--sponsors end-->
## Contributing
We're open to all community contributions! If you'd like to contribute in any way, please first read
our [Contributing Guide](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md).
## License
ISC

View File

@@ -9,20 +9,42 @@ 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=
DESCOPE_ID=
DESCOPE_SECRET=
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 +52,16 @@ TWITCH_SECRET=
TWITTER_ID=
TWITTER_SECRET=
LINE_ID=
LINE_SECRET=
WIKIMEDIA_ID=
WIKIMEDIA_SECRET=
TRAKT_ID=
TRAKT_SECRET=
# Yandex OAuth. new app -> https://oauth.yandex.com/client/new/id
YANDEX_ID=
YANDEX_SECRET=
# ClickUp OAuth. https://clickup.com/api/
CLICK_UP_ID=
CLICK_UP_SECRET=
# Example configuration for a Gmail account (will need SMTP enabled)
EMAIL_SERVER=smtps://user@gmail.com:password@smtp.gmail.com:465
@@ -47,12 +74,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

5
apps/dev/nextjs/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
node_modules/
/test-results/
/playwright-report/
/playwright/.cache/
dbschema/edgeql-js

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

@@ -0,0 +1,71 @@
module default {
type User {
property name -> str;
required property email -> str {
constraint exclusive;
}
property emailVerified -> datetime;
property image -> str;
multi link accounts := .<user[is Account];
multi link sessions := .<user[is Session];
property createdAt -> datetime {
default := datetime_current();
};
}
type Account {
required property userId := .user.id;
required property type -> str;
required property provider -> str;
required property providerAccountId -> str {
constraint exclusive;
};
property refresh_token -> str;
property access_token -> str;
property expires_at -> int64;
property token_type -> str;
property scope -> str;
property id_token -> str;
property session_state -> str;
required link user -> User {
on target delete delete source;
};
property createdAt -> datetime {
default := datetime_current();
};
constraint exclusive on ((.provider, .providerAccountId))
}
type Session {
required property sessionToken -> str {
constraint exclusive;
}
required property userId := .user.id;
required property expires -> datetime;
required link user -> User {
on target delete delete source;
};
property createdAt -> datetime {
default := datetime_current();
};
}
type VerificationToken {
required property identifier -> str;
required property token -> str {
constraint exclusive;
}
required property expires -> datetime;
property createdAt -> datetime {
default := datetime_current();
};
constraint exclusive on ((.identifier, .token))
}
}
# Disable the application of access policies within access policies
# themselves. This behavior will become the default in EdgeDB 3.0.
# See: https://www.edgedb.com/docs/reference/ddl/access_policies#nonrecursive
using future nonrecursive_access_policies;

View File

@@ -0,0 +1,2 @@
[edgedb]
server-version = "2.6"

View File

@@ -1,5 +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

@@ -9,32 +9,38 @@
"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": {
"@next-auth/fauna-adapter": "workspace:*",
"@next-auth/prisma-adapter": "workspace:*",
"@next-auth/supabase-adapter": "workspace:*",
"@next-auth/typeorm-legacy-adapter": "workspace:*",
"@auth/core": "workspace:*",
"@auth/edgedb-adapter": "workspace:*",
"@auth/fauna-adapter": "workspace:*",
"@auth/prisma-adapter": "workspace:*",
"@auth/supabase-adapter": "workspace:*",
"@auth/typeorm-adapter": "workspace:*",
"@prisma/client": "^3",
"edgedb": "^1.0.1",
"@supabase/supabase-js": "^2.0.5",
"faunadb": "^4",
"next": "13.1.1",
"next": "13.4.0",
"next-auth": "workspace:*",
"@auth/core": "workspace:*",
"nodemailer": "^6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@edgedb/generate": "^0.0.4",
"@playwright/test": "1.29.2",
"@types/jsonwebtoken": "^8.5.5",
"@types/react": "^18.0.15",
"@types/react": "18.0.37",
"@types/react-dom": "^18.0.6",
"dotenv": "^16.0.3",
"fake-smtp-server": "^0.8.0",
"pg": "^8.7.3",
"prisma": "^3",
"sqlite3": "^5.0.8",
"typeorm": "0.3.7"
"typeorm": "0.3.17"
}
}

View File

@@ -2,12 +2,15 @@ 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"
import Descope from "@auth/core/providers/descope"
import Discord from "@auth/core/providers/discord"
import DuendeIDS6 from "@auth/core/providers/duende-identity-server6"
// import Email from "@auth/core/providers/email"
@@ -23,6 +26,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"
@@ -31,28 +35,29 @@ 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 Yandex from "@auth/core/providers/yandex"
import Vk from "@auth/core/providers/vk"
import Wikimedia from "@auth/core/providers/wikimedia"
import WorkOS from "@auth/core/providers/workos"
import ClickUp from '@auth/core/providers/click-up'
// // Prisma
// import { PrismaClient } from "@prisma/client"
// import { PrismaAdapter } from "@next-auth/prisma-adapter"
// import { PrismaAdapter } from "@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"
// import { FaunaAdapter } from "@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({
// import { TypeORMAdapter } from "@auth/typeorm-adapter"
// const adapter = TypeORMAdapter({
// type: "sqlite",
// name: "next-auth-test-memory",
// database: "./typeorm/dev.db",
@@ -60,15 +65,21 @@ import WorkOS from "@auth/core/providers/workos"
// })
// // Supabase
// import { SupabaseAdapter } from "@next-auth/supabase-adapter"
// import { SupabaseAdapter } from "@auth/supabase-adapter"
// const adapter = SupabaseAdapter({
// url: process.env.NEXT_PUBLIC_SUPABASE_URL,
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
// })
// // EdgeDB
// import { EdgeDBAdapter } from "@auth/edgedb-adapter"
// import { createHttpClient } from "edgedb"
// const client = createHttpClient()
// const adapter = EdgeDBAdapter(client)
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",
@@ -81,7 +92,8 @@ export const authConfig: AuthConfig = {
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 }),
Apple({ clientId: process.env.APPLE_ID, clientSecret: process.env.APPLE_SECRET as string }),
// 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,14 +101,20 @@ 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 }),
Descope({ clientId: process.env.DESCOPE_ID, clientSecret: process.env.DESCOPE_SECRET }),
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 }),
GitHub({ clientId: process.env.GITHUB_ID, clientSecret: process.env.GITHUB_SECRET, redirectProxyUrl: process.env.AUTH_REDIRECT_PROXY_URL }),
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 }),
@@ -105,6 +123,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 as string }),
// 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 }),
@@ -114,9 +133,11 @@ export const authConfig: AuthConfig = {
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 }),
Yandex({ clientId: process.env.YANDEX_ID, clientSecret: process.env.YANDEX_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 }),
ClickUp({ clientId: process.env.CLICK_UP_ID, clientSecret: process.env.CLICK_UP_SECRET })
],
// debug: process.env.NODE_ENV !== "production",
}
@@ -148,4 +169,4 @@ function AuthHandler(...args: any[]) {
export default AuthHandler(authConfig)
export const config = { runtime: "experimental-edge" }
export const config = { runtime: "edge" }

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,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

@@ -15,12 +15,12 @@
"@sveltejs/kit": "next",
"svelte": "3.55.0",
"svelte-check": "2.10.2",
"typescript": "4.9.4",
"vite": "4.0.1"
"typescript": "5.2.2",
"vite": "4.0.5"
},
"dependencies": {
"@auth/core": "latest",
"@auth/sveltekit": "latest"
"@auth/core": "workspace:*",
"@auth/sveltekit": "workspace:*"
},
"type": "module"
}

View File

@@ -1,15 +1,14 @@
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET= # Linux: `openssl rand -hex 32` or go to https://generate-secret.now.sh/32
APPLE_ID=
APPLE_TEAM_ID=
APPLE_PRIVATE_KEY=
APPLE_KEY_ID=
AUTH0_ID=
AUTH0_SECRET=
AUTH0_ISSUER=
DESCOPE_ID=
DESCOPE_SECRET=
FACEBOOK_ID=
FACEBOOK_SECRET=
@@ -21,8 +20,3 @@ GOOGLE_SECRET=
TWITTER_ID=
TWITTER_SECRET=
EMAIL_SERVER=smtp://username:password@smtp.example.com:587
EMAIL_FROM=NextAuth <noreply@example.com>
DATABASE_URL=sqlite://localhost/:memory:?synchronize=true

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>

View File

@@ -0,0 +1,5 @@
import NextAuth from "next-auth/next"
import { config } from "auth"
const handler = NextAuth(config)
export { handler as GET, handler as POST }

View File

@@ -0,0 +1,294 @@
import type { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from "next"
import type { NextAuthOptions as NextAuthConfig } from "next-auth"
import { getServerSession } from "next-auth"
import Apple from "next-auth/providers/apple"
import Atlassian from "next-auth/providers/atlassian"
import Auth0 from "next-auth/providers/auth0"
import Authentik from "next-auth/providers/authentik"
import AzureAD from "next-auth/providers/azure-ad"
import AzureB2C from "next-auth/providers/azure-ad-b2c"
import Battlenet from "next-auth/providers/battlenet"
import Box from "next-auth/providers/box"
import BoxyHQSAML from "next-auth/providers/boxyhq-saml"
import Bungie from "next-auth/providers/bungie"
import Cognito from "next-auth/providers/cognito"
import Coinbase from "next-auth/providers/coinbase"
import Discord from "next-auth/providers/discord"
import Dropbox from "next-auth/providers/dropbox"
import DuendeIDS6 from "next-auth/providers/duende-identity-server6"
import Eveonline from "next-auth/providers/eveonline"
import Facebook from "next-auth/providers/facebook"
import Faceit from "next-auth/providers/faceit"
import FortyTwoSchool from "next-auth/providers/42-school"
import Foursquare from "next-auth/providers/foursquare"
import Freshbooks from "next-auth/providers/freshbooks"
import Fusionauth from "next-auth/providers/fusionauth"
import GitHub from "next-auth/providers/github"
import Gitlab from "next-auth/providers/gitlab"
import Google from "next-auth/providers/google"
import Hubspot from "next-auth/providers/hubspot"
import Instagram from "next-auth/providers/instagram"
import Kakao from "next-auth/providers/kakao"
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 Mailru from "next-auth/providers/mailru"
import Medium from "next-auth/providers/medium"
import Naver from "next-auth/providers/naver"
import Netlify from "next-auth/providers/netlify"
import Okta from "next-auth/providers/okta"
import Onelogin from "next-auth/providers/onelogin"
import Osso from "next-auth/providers/osso"
import Osu from "next-auth/providers/osu"
import Passage from "next-auth/providers/passage"
import Patreon from "next-auth/providers/patreon"
import Pinterest from "next-auth/providers/pinterest"
import Pipedrive from "next-auth/providers/pipedrive"
import Reddit from "next-auth/providers/reddit"
import Salesforce from "next-auth/providers/salesforce"
import Slack from "next-auth/providers/slack"
import Spotify from "next-auth/providers/spotify"
import Strava from "next-auth/providers/strava"
import Todoist from "next-auth/providers/todoist"
import Trakt from "next-auth/providers/trakt"
import Twitch from "next-auth/providers/twitch"
import Twitter from "next-auth/providers/twitter"
import UnitedEffects from "next-auth/providers/united-effects"
import Vk from "next-auth/providers/vk"
import Wikimedia from "next-auth/providers/wikimedia"
import Wordpress from "next-auth/providers/wordpress"
import WorkOS from "next-auth/providers/workos"
import Yandex from "next-auth/providers/yandex"
import Zitadel from "next-auth/providers/zitadel"
import Zoho from "next-auth/providers/zoho"
import Zoom from "next-auth/providers/zoom"
// Read more at: https://next-auth.js.org/getting-started/typescript#module-augmentation
declare module "next-auth/jwt" {
interface JWT {
/** The user's role. */
userRole?: "admin"
}
}
export const config = {
providers: [
Apple({ clientId: process.env.AUTH_APPLE_ID, clientSecret: process.env.AUTH_APPLE_SECRET }),
Atlassian({ clientId: process.env.AUTH_ATLASSIAN_ID, clientSecret: process.env.AUTH_ATLASSIAN_SECRET }),
Auth0({ clientId: process.env.AUTH_AUTH0_ID, clientSecret: process.env.AUTH_AUTH0_SECRET, issuer: process.env.AUTH_AUTH0_ISSUER }),
Authentik({ clientId: process.env.AUTH_AUTHENTIK_ID, clientSecret: process.env.AUTH_AUTHENTIK_SECRET }),
AzureAD({ clientId: process.env.AUTH_AZUREAD_ID, clientSecret: process.env.AUTH_AZUREAD_SECRET }),
AzureB2C({ clientId: process.env.AUTH_AZUREB2C_ID, clientSecret: process.env.AUTH_AZUREB2C_SECRET }),
Battlenet({ clientId: process.env.AUTH_BN_ID, clientSecret: process.env.AUTH_BN_SECRET, issuer: process.env.AUTH_BN_ISSUER }),
Box({ clientId: process.env.AUTH_BOX_ID, clientSecret: process.env.AUTH_BOX_SECRET }),
BoxyHQSAML({ clientId: process.env.AUTH_BOXYHQ_ID, clientSecret: process.env.AUTH_BOXYHQ_SECRET, issuer: process.env.AUTH_BOXYHQ_ISSUER }),
Bungie({ clientId: process.env.AUTH_BUNGIE_ID, clientSecret: process.env.AUTH_BUNGIE_SECRET }),
Cognito({ clientId: process.env.AUTH_COGNITO_ID, clientSecret: process.env.AUTH_COGNITO_SECRET, issuer: process.env.AUTH_COGNITO_ISSUER }),
Coinbase({ clientId: process.env.AUTH_COINBASE_ID, clientSecret: process.env.AUTH_COINBASE_SECRET }),
Discord({ clientId: process.env.AUTH_DISCORD_ID, clientSecret: process.env.AUTH_DISCORD_SECRET }),
Dropbox({ clientId: process.env.AUTH_DROPBOX_ID, clientSecret: process.env.AUTH_DROPBOX_SECRET }),
DuendeIDS6({ clientId: process.env.AUTH_DUENDEIDS6_ID, clientSecret: process.env.AUTH_DUENDEIDS6_SECRET }),
Eveonline({ clientId: process.env.AUTH_EVEONLINE_ID, clientSecret: process.env.AUTH_EVEONLINE_SECRET }),
Facebook({ clientId: process.env.AUTH_FACEBOOK_ID, clientSecret: process.env.AUTH_FACEBOOK_SECRET }),
Faceit({ clientId: process.env.AUTH_FACEIT_ID, clientSecret: process.env.AUTH_FACEIT_SECRET }),
FortyTwoSchool({ clientId: process.env.AUTH_FORTYTWOSCHOOL_ID, clientSecret: process.env.AUTH_FORTYTWOSCHOOL_SECRET }),
Foursquare({ clientId: process.env.AUTH_FOURSQUARE_ID, clientSecret: process.env.AUTH_FOURSQUARE_SECRET }),
Freshbooks({ clientId: process.env.AUTH_FRESHBOOKS_ID, clientSecret: process.env.AUTH_FRESHBOOKS_SECRET }),
Fusionauth({ clientId: process.env.AUTH_FUSIONAUTH_ID, clientSecret: process.env.AUTH_FUSIONAUTH_SECRET }),
GitHub({ clientId: process.env.AUTH_GITHUB_ID, clientSecret: process.env.AUTH_GITHUB_SECRET }),
Gitlab({ clientId: process.env.AUTH_GITLAB_ID, clientSecret: process.env.AUTH_GITLAB_SECRET }),
Google({ clientId: process.env.AUTH_GOOGLE_ID, clientSecret: process.env.AUTH_GOOGLE_SECRET }),
Hubspot({ clientId: process.env.AUTH_HUBSPOT_ID, clientSecret: process.env.AUTH_HUBSPOT_SECRET }),
Instagram({ clientId: process.env.AUTH_INSTAGRAM_ID, clientSecret: process.env.AUTH_INSTAGRAM_SECRET }),
Kakao({ clientId: process.env.AUTH_KAKAO_ID, clientSecret: process.env.AUTH_KAKAO_SECRET }),
Keycloak({ clientId: process.env.AUTH_KEYCLOAK_ID, clientSecret: process.env.AUTH_KEYCLOAK_SECRET }),
Line({ clientId: process.env.AUTH_LINE_ID, clientSecret: process.env.AUTH_LINE_SECRET }),
LinkedIn({ clientId: process.env.AUTH_LINKEDIN_ID, clientSecret: process.env.AUTH_LINKEDIN_SECRET }),
Mailchimp({ clientId: process.env.AUTH_MAILCHIMP_ID, clientSecret: process.env.AUTH_MAILCHIMP_SECRET }),
Mailru({ clientId: process.env.AUTH_MAILRU_ID, clientSecret: process.env.AUTH_MAILRU_SECRET }),
Medium({ clientId: process.env.AUTH_MEDIUM_ID, clientSecret: process.env.AUTH_MEDIUM_SECRET }),
Naver({ clientId: process.env.AUTH_NAVER_ID, clientSecret: process.env.AUTH_NAVER_SECRET }),
Netlify({ clientId: process.env.AUTH_NETLIFY_ID, clientSecret: process.env.AUTH_NETLIFY_SECRET }),
Okta({ clientId: process.env.AUTH_OKTA_ID, clientSecret: process.env.AUTH_OKTA_SECRET }),
Onelogin({ clientId: process.env.AUTH_ONELOGIN_ID, clientSecret: process.env.AUTH_ONELOGIN_SECRET }),
Osso({ clientId: process.env.AUTH_OSSO_ID, clientSecret: process.env.AUTH_OSSO_SECRET, issuer: process.env.AUTH_OSSO_ISSUER }),
Osu({ clientId: process.env.AUTH_OSU_ID, clientSecret: process.env.AUTH_OSU_SECRET }),
Passage({ clientId: process.env.AUTH_PASSAGE_ID, clientSecret: process.env.AUTH_PASSAGE_SECRET, issuer: process.env.AUTH_PASSAGE_ISSUER }),
Patreon({ clientId: process.env.AUTH_PATREON_ID, clientSecret: process.env.AUTH_PATREON_SECRET }),
Pinterest({ clientId: process.env.AUTH_PINTEREST_ID, clientSecret: process.env.AUTH_PINTEREST_SECRET }),
Pipedrive({ clientId: process.env.AUTH_PIPEDRIVE_ID, clientSecret: process.env.AUTH_PIPEDRIVE_SECRET }),
Reddit({ clientId: process.env.AUTH_REDDIT_ID, clientSecret: process.env.AUTH_REDDIT_SECRET }),
Salesforce({ clientId: process.env.AUTH_SALESFORCE_ID, clientSecret: process.env.AUTH_SALESFORCE_SECRET }),
Slack({ clientId: process.env.AUTH_SLACK_ID, clientSecret: process.env.AUTH_SLACK_SECRET }),
Spotify({ clientId: process.env.AUTH_SPOTIFY_ID, clientSecret: process.env.AUTH_SPOTIFY_SECRET }),
Strava({ clientId: process.env.AUTH_STRAVA_ID, clientSecret: process.env.AUTH_STRAVA_SECRET }),
Todoist({ clientId: process.env.AUTH_TODOIST_ID, clientSecret: process.env.AUTH_TODOIST_SECRET }),
Trakt({ clientId: process.env.AUTH_TRAKT_ID, clientSecret: process.env.AUTH_TRAKT_SECRET }),
Twitch({ clientId: process.env.AUTH_TWITCH_ID, clientSecret: process.env.AUTH_TWITCH_SECRET }),
Twitter({ clientId: process.env.AUTH_TWITTER_ID, clientSecret: process.env.AUTH_TWITTER_SECRET, version: "2.0" }),
UnitedEffects({ clientId: process.env.AUTH_UE_ID, clientSecret: process.env.AUTH_UE_SECRET, issuer: process.env.AUTH_UE_ISSUER }),
Vk({ clientId: process.env.AUTH_VK_ID, clientSecret: process.env.AUTH_VK_SECRET }),
Wikimedia({ clientId: process.env.AUTH_WIKIMEDIA_ID, clientSecret: process.env.AUTH_WIKIMEDIA_SECRET }),
Wordpress({ clientId: process.env.AUTH_WORDPRESS_ID, clientSecret: process.env.AUTH_WORDPRESS_SECRET }),
WorkOS({ clientId: process.env.AUTH_WORKOS_ID, clientSecret: process.env.AUTH_WORKOS_SECRET }),
Yandex({ clientId: process.env.AUTH_YANDEX_ID, clientSecret: process.env.AUTH_YANDEX_SECRET }),
Zitadel({ clientId: process.env.AUTH_ZITADEL_ID, clientSecret: process.env.AUTH_ZITADEL_SECRET }),
Zoho({ clientId: process.env.AUTH_ZOHO_ID, clientSecret: process.env.AUTH_ZOHO_SECRET }),
Zoom({ clientId: process.env.AUTH_ZOOM_ID, clientSecret: process.env.AUTH_ZOOM_SECRET }),
],
callbacks: {
async jwt({ token }) {
token.userRole = "admin"
return token
},
},
} satisfies NextAuthConfig
// Helper function to get session without passing config every time
// https://next-auth.js.org/configuration/nextjs#getserversession
export function auth(...args: [GetServerSidePropsContext["req"], GetServerSidePropsContext["res"]] | [NextApiRequest, NextApiResponse] | []) {
return getServerSession(...args, config)
}
// We recommend doing your own environment variable validation
declare global {
namespace NodeJS {
export interface ProcessEnv {
NEXTAUTH_SECRET: string
AUTH_APPLE_ID: string
AUTH_APPLE_SECRET: string
AUTH_ATLASSIAN_ID: string
AUTH_ATLASSIAN_SECRET: string
AUTH_AUTH0_ID: string
AUTH_AUTH0_ISSUER: string
AUTH_AUTH0_SECRET: string
AUTH_AUTHENTIK_ID: string
AUTH_AUTHENTIK_SECRET: string
AUTH_AZUREAD_ID: string
AUTH_AZUREAD_SECRET: string
AUTH_AZUREB2C_ID: string
AUTH_AZUREB2C_SECRET: string
AUTH_BN_ID: string
AUTH_BN_ISSUER: any
AUTH_BN_SECRET: string
AUTH_BOX_ID: string
AUTH_BOX_SECRET: string
AUTH_BOXYHQ_ID: string
AUTH_BOXYHQ_ISSUER: string
AUTH_BOXYHQ_SECRET: string
AUTH_BUNGIE_ID: string
AUTH_BUNGIE_SECRET: string
AUTH_COGNITO_ID: string
AUTH_COGNITO_ISSUER: string
AUTH_COGNITO_SECRET: string
AUTH_COINBASE_ID: string
AUTH_COINBASE_SECRET: string
AUTH_DISCORD_ID: string
AUTH_DISCORD_SECRET: string
AUTH_DROPBOX_ID: string
AUTH_DROPBOX_SECRET: string
AUTH_DUENDEIDS6_ID: string
AUTH_DUENDEIDS6_SECRET: string
AUTH_EVEONLINE_ID: string
AUTH_EVEONLINE_SECRET: string
AUTH_FACEBOOK_ID: string
AUTH_FACEBOOK_SECRET: string
AUTH_FACEIT_ID: string
AUTH_FACEIT_SECRET: string
AUTH_FORTYTWOSCHOOL_ID: string
AUTH_FORTYTWOSCHOOL_SECRET: string
AUTH_FOURSQUARE_ID: string
AUTH_FOURSQUARE_SECRET: string
AUTH_FRESHBOOKS_ID: string
AUTH_FRESHBOOKS_SECRET: string
AUTH_FUSIONAUTH_ID: string
AUTH_FUSIONAUTH_SECRET: string
AUTH_GITHUB_ID: string
AUTH_GITHUB_SECRET: string
AUTH_GITLAB_ID: string
AUTH_GITLAB_SECRET: string
AUTH_GOOGLE_ID: string
AUTH_GOOGLE_SECRET: string
AUTH_HUBSPOT_ID: string
AUTH_HUBSPOT_SECRET: string
AUTH_INSTAGRAM_ID: string
AUTH_INSTAGRAM_SECRET: string
AUTH_KAKAO_ID: string
AUTH_KAKAO_SECRET: string
AUTH_KEYCLOAK_ID: string
AUTH_KEYCLOAK_SECRET: string
AUTH_LINE_ID: string
AUTH_LINE_SECRET: string
AUTH_LINKEDIN_ID: string
AUTH_LINKEDIN_SECRET: string
AUTH_MAILCHIMP_ID: string
AUTH_MAILCHIMP_SECRET: string
AUTH_MAILRU_ID: string
AUTH_MAILRU_SECRET: string
AUTH_MEDIUM_ID: string
AUTH_MEDIUM_SECRET: string
AUTH_NAVER_ID: string
AUTH_NAVER_SECRET: string
AUTH_NETLIFY_ID: string
AUTH_NETLIFY_SECRET: string
AUTH_OKTA_ID: string
AUTH_OKTA_SECRET: string
AUTH_ONELOGIN_ID: string
AUTH_ONELOGIN_SECRET: string
AUTH_OSSO_ID: string
AUTH_OSSO_ISSUER: string
AUTH_OSSO_SECRET: string
AUTH_OSU_ID: string
AUTH_OSU_SECRET: string
AUTH_PASSAGE_ID: string
AUTH_PASSAGE_ISSUER: string
AUTH_PASSAGE_SECRET: string
AUTH_PATREON_ID: string
AUTH_PATREON_SECRET: string
AUTH_PINTEREST_ID: string
AUTH_PINTEREST_SECRET: string
AUTH_PIPEDRIVE_ID: string
AUTH_PIPEDRIVE_SECRET: string
AUTH_REDDIT_ID: string
AUTH_REDDIT_SECRET: string
AUTH_SALESFORCE_ID: string
AUTH_SALESFORCE_SECRET: string
AUTH_SLACK_ID: string
AUTH_SLACK_SECRET: string
AUTH_SPOTIFY_ID: string
AUTH_SPOTIFY_SECRET: string
AUTH_STRAVA_ID: string
AUTH_STRAVA_SECRET: string
AUTH_TODOIST_ID: string
AUTH_TODOIST_SECRET: string
AUTH_TRAKT_ID: string
AUTH_TRAKT_SECRET: string
AUTH_TWITCH_ID: string
AUTH_TWITCH_SECRET: string
AUTH_TWITTER_ID: string
AUTH_TWITTER_SECRET: string
AUTH_UE_ID: string
AUTH_UE_ISSUER: string
AUTH_UE_SECRET: string
AUTH_VK_ID: string
AUTH_VK_SECRET: string
AUTH_WIKIMEDIA_ID: string
AUTH_WIKIMEDIA_SECRET: string
AUTH_WORDPRESS_ID: string
AUTH_WORDPRESS_SECRET: string
AUTH_WORKOS_ID: string
AUTH_WORKOS_SECRET: string
AUTH_YANDEX_ID: string
AUTH_YANDEX_SECRET: string
AUTH_ZITADEL_ID: string
AUTH_ZITADEL_SECRET: string
AUTH_ZOHO_ID: string
AUTH_ZOHO_SECRET: string
AUTH_ZOOM_ID: string
AUTH_ZOOM_SECRET: string
}
}
}

View File

@@ -1,10 +0,0 @@
import "next-auth/jwt"
// Read more at: https://next-auth.js.org/getting-started/typescript#module-augmentation
declare module "next-auth/jwt" {
interface JWT {
/** The user's role. */
userRole?: "admin"
}
}

View File

@@ -0,0 +1,4 @@
/** @type {import("next").NextConfig} */
module.exports = {
reactStrictMode: true,
}

View File

@@ -20,13 +20,12 @@
"dependencies": {
"next": "latest",
"next-auth": "latest",
"nodemailer": "^6",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^17",
"@types/react": "^18.0.15",
"typescript": "^4"
"@types/node": "^18.16.2",
"@types/react": "^18.2.0",
"typescript": "5.2.2"
}
}

View File

@@ -7,7 +7,7 @@ export default function Page() {
<p>Only admin users can see this page.</p>
<p>
To learn more about the NextAuth middleware see&nbsp;
<a href="https://docs-git-misc-docs-nextauthjs.vercel.app/configuration/nextjs#middleware">
<a href="https://next-auth.js.org/configuration/nextjs#middleware">
the docs
</a>
.

View File

@@ -1,65 +0,0 @@
import NextAuth, { NextAuthOptions } from "next-auth"
import GoogleProvider from "next-auth/providers/google"
import FacebookProvider from "next-auth/providers/facebook"
import GithubProvider from "next-auth/providers/github"
import TwitterProvider from "next-auth/providers/twitter"
import Auth0Provider from "next-auth/providers/auth0"
// import AppleProvider from "next-auth/providers/apple"
// import EmailProvider from "next-auth/providers/email"
// For more information on each option (and a full list of options) go to
// https://next-auth.js.org/configuration/options
export const authOptions: NextAuthOptions = {
// https://next-auth.js.org/configuration/providers/oauth
providers: [
/* EmailProvider({
server: process.env.EMAIL_SERVER,
from: process.env.EMAIL_FROM,
}),
// Temporarily removing the Apple provider from the demo site as the
// callback URL for it needs updating due to Vercel changing domains
Providers.Apple({
clientId: process.env.APPLE_ID,
clientSecret: {
appleId: process.env.APPLE_ID,
teamId: process.env.APPLE_TEAM_ID,
privateKey: process.env.APPLE_PRIVATE_KEY,
keyId: process.env.APPLE_KEY_ID,
},
}),
*/
FacebookProvider({
clientId: process.env.FACEBOOK_ID,
clientSecret: process.env.FACEBOOK_SECRET,
}),
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
GoogleProvider({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
TwitterProvider({
clientId: process.env.TWITTER_ID,
clientSecret: process.env.TWITTER_SECRET,
}),
Auth0Provider({
clientId: process.env.AUTH0_ID,
clientSecret: process.env.AUTH0_SECRET,
issuer: process.env.AUTH0_ISSUER,
}),
],
theme: {
colorScheme: "light",
},
callbacks: {
async jwt({ token }) {
token.userRole = "admin"
return token
},
},
}
export default NextAuth(authOptions)

View File

@@ -1,14 +1,13 @@
// This is an example of to protect an API route
import { unstable_getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
import { auth } from "auth"
import type { NextApiRequest, NextApiResponse } from "next"
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const session = await unstable_getServerSession(req, res, authOptions)
const session = await auth(req, res)
if (session) {
return res.send({

View File

@@ -1,13 +1,12 @@
// This is an example of how to access a session from an API route
import { unstable_getServerSession } from "next-auth"
import { authOptions } from "../auth/[...nextauth]"
import { auth } from "auth"
import type { NextApiRequest, NextApiResponse } from "next"
export default async function handler(
req: NextApiRequest,
res: NextApiResponse
) {
const session = await unstable_getServerSession(req, res, authOptions)
const session = await auth(req, res)
res.send(JSON.stringify(session, null, 2))
}

View File

@@ -1,22 +1,22 @@
import { unstable_getServerSession } from "next-auth/next"
import { authOptions } from "./api/auth/[...nextauth]"
import { auth } from "auth"
import Layout from "../components/layout"
import type { GetServerSidePropsContext } from "next"
import type { Session } from "next-auth"
import { useSession } from "next-auth/react"
export default function ServerSidePage({ session }: { session: Session }) {
export default function ServerSidePage() {
const { data: session } = useSession()
// As this page uses Server Side Rendering, the `session` will be already
// populated on render without needing to go through a loading stage.
return (
<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 the recommended approach if you
need to support Server Side Rendering with authentication.
</p>
@@ -35,13 +35,5 @@ export default function ServerSidePage({ session }: { session: Session }) {
// Export the `session` prop to use sessions with Server Side Rendering
export async function getServerSideProps(context: GetServerSidePropsContext) {
return {
props: {
session: await unstable_getServerSession(
context.req,
context.res,
authOptions
),
},
}
return { props: { session: await auth(context.req, context.res) } }
}

View File

@@ -1,16 +0,0 @@
declare namespace NodeJS {
export interface ProcessEnv {
NEXTAUTH_URL: string
NEXTAUTH_SECRET: string
GITHUB_ID: string
GITHUB_SECRET: string
FACEBOOK_ID: string
FACEBOOK_SECRET: string
TWITTER_ID: string
TWITTER_SECRET: string
GOOGLE_ID: string
GOOGLE_SECRET: string
AUTH0_ID: string
AUTH0_SECRET: string
}
}

View File

@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
@@ -13,14 +17,22 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"baseUrl": ".",
"plugins": [
{
"name": "next"
}
]
},
"include": [
"process.d.ts",
"next-env.d.ts",
"next-auth.d.ts",
"**/*.ts",
"**/*.tsx"
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": ["node_modules"]
"exclude": [
"node_modules"
]
}

View File

@@ -1,37 +0,0 @@
# Create JD App
This project was created using [Create JD App](https://github.com/OrJDev/create-jd-app)
## Deploying To Vercel
### Installing
```bash
npm install solid-start-vercel@latest -D
```
### Adding to vite config
```ts
import solid from "solid-start/vite";
import dotenv from "dotenv";
import { defineConfig } from "vite";
// @ts-expect-error no typing
import vercel from "solid-start-vercel";
export default defineConfig(() => {
dotenv.config();
return {
plugins: [solid({ ssr: true, adapter: vercel({ edge: false }) })],
};
});
```
### Enviroment Variables
- `ENABLE_VC_BUILD`=`1` .
### You Are Done
Create a github repo and push your code to it, then deploy it to vercel (:

View File

@@ -0,0 +1,85 @@
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/examples/solid-start). 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 height="64" src="https://authjs.dev/img/logo/logo-sm.png" />
</a>
<a href="https://start.solidjs.com" target="_blank">
<img height="64" src="https://www.solidjs.com/assets/logo-123b04bc.svg" />
</a>
<h3 align="center"><b>SolidStart Auth</b> - 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/@auth/solid-start">
<img alt="npm" src="https://img.shields.io/npm/v/@auth/solid-start?color=green&label=@auth/solid-start&style=flat-square">
</a>
<a href="https://bundlephobia.com/result?p=@auth/solid-start">
<img src="https://img.shields.io/bundlephobia/minzip/@auth/solid-start?label=size&style=flat-square" alt="Bundle Size"/>
</a>
<a href="https://www.npmtrends.com/@auth/solid-start">
<img src="https://img.shields.io/npm/dm/@auth/solid-start?label=downloads&style=flat-square" alt="Downloads" />
</a>
<a href="https://npm.im/@auth/solid-start">
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
</a>
</p>
</p>
## Overview
This is the official SolidStart Auth example for [Auth.js](https://authjs.dev).
## Getting started
You can follow the guide below, or click the following button to deploy this example to [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=solid-start-auth-example).
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/nextauthjs/solid-start-auth-example&project-name=solid-start-auth-example&repository-name=solid-start-auth-example)
### Installing
```sh
pnpm add -D solid-start-vercel
```
```sh
npm i -D solid-start-vercel
```
```sh
yarn add -D solid-start-vercel
```
### Adding to Vite config
```ts
import solid from "solid-start/vite";
import dotenv from "dotenv";
import { defineConfig } from "vite";
// @ts-expect-error no typing
import vercel from "solid-start-vercel";
export default defineConfig(() => {
dotenv.config();
return {
plugins: [solid({ ssr: true, adapter: vercel({ edge: false }) })],
};
});
```
### Environment Variables
- `ENABLE_VC_BUILD`=`1` .
### Finishing up
Create a GitHub repo and push the code to it, then deploy it to Vercel.
## Acknowledgements
<a href="https://vercel.com?utm_source=nextauthjs&utm_campaign=oss">
<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 Auth.js Team</p>

View File

@@ -13,11 +13,11 @@
"solid-start-node": "^0.2.9",
"solid-start-vercel": "^0.2.9",
"tailwindcss": "^3.2.4",
"typescript": "^4.8.3",
"typescript": "5.2.2",
"vite": "^3.1.0"
},
"dependencies": {
"@auth/core": "^0.1.4",
"@auth/core": "latest",
"@solid-auth/next": "^0.0.19",
"@solidjs/meta": "^0.28.0",
"@solidjs/router": "^0.6.0",

View File

@@ -3,7 +3,7 @@ import { Protected } from "~/components";
export const { routeData, Page } = Protected((session) => {
return (
<main class="flex flex-col gap-2 items-center">
<h1>This is a proteced route</h1>
<h1>This is a protected route</h1>
</main>
);
});

View File

@@ -1,9 +1,14 @@
> 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).
> The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/examples/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>
<a href="https://authjs.dev" target="_blank">
<img height="64" src="https://authjs.dev/img/logo/logo-sm.png" />
</a>
<a href="https://kit.svelte.dev" target="_blank">
<img height="64" src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Svelte_Logo.svg" />
</a>
<h3 align="center"><b>SvelteKit Auth</b> - Example App</h3>
<p align="center">
Open Source. Full Stack. Own Your Data.
</p>
@@ -11,18 +16,24 @@
<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">
<a href="https://bundlephobia.com/result?p=@auth/sveltekit">
<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" />
<img src="https://img.shields.io/npm/dm/@auth/sveltekit?label=downloads&style=flat-square" alt="Downloads" />
</a>
<a href="https://npm.im/next-auth">
<a href="https://npm.im/@auth/sveltekit">
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
</a>
</p>
</p>
# Documentation
## Overview
- [sveltekit.authjs.dev](https://sveltekit.authjs.dev)
This is the official SvelteKit Auth example for [Auth.js](https://sveltekit.authjs.dev).
## Getting started
You can instantly deploy this example to [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=sveltekit-auth-example) by clicking the following button.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/nextauthjs/sveltekit-auth-example&project-name=sveltekit-auth-example&repository-name=sveltekit-auth-example)

View File

@@ -18,7 +18,7 @@
"@sveltejs/kit": "next",
"svelte": "3.55.0",
"svelte-check": "2.10.2",
"typescript": "4.9.4",
"typescript": "5.2.2",
"vite": "4.0.1"
},
"dependencies": {

View File

@@ -20,10 +20,10 @@
$page.data.session.user?.name}</strong
>
</span>
<a href="/auth/signout" class="button">Sign out</a>
<a href="/auth/signout" class="button" data-sveltekit-preload-data="off">Sign out</a>
{:else}
<span class="notSignedInText">You are not signed in</span>
<a href="/auth/signin" class="buttonPrimary">Sign in</a>
<a href="/auth/signin" class="buttonPrimary" data-sveltekit-preload-data="off">Sign in</a>
{/if}
</p>
</div>

View File

@@ -22,7 +22,7 @@
## Overview
Auth.js is a complete open source authentication solution.
Auth.js is a complete open-source authentication solution.
This is an example application that shows how `@auth/core` 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.
@@ -30,7 +30,7 @@ The deployed version can be found at [`next-auth-gatsby-example.vercel.app`](htt
### About Auth.js
Auth.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.
Auth.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 [authjs.dev](https://authjs.dev) for more information and documentation.

View File

@@ -10,13 +10,13 @@
"clean": "gatsby clean"
},
"dependencies": {
"dotenv": "^16.0.0",
"gatsby": "next",
"next-auth": "latest",
"react": "^18",
"react-dom": "^18"
"dotenv": "16.0.0",
"gatsby": "5.8.0-next.3",
"next-auth": "workspace:*",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"vercel": "^23.1.2"
"vercel": "23.1.2"
}
}

View File

@@ -1,4 +1,4 @@
import { Session } from "@auth/core"
import { Session } from "@auth/core/types"
export default function useSession() {
return useState<Session | null>("session", () => null)

View File

@@ -43,7 +43,7 @@ export async function signIn<
// TODO: Handle custom base path
// TODO: Remove this since Sveltekit offers the CSRF protection via origin check
const { csrfToken } = await $fetch("/api/auth/csrf")
const { csrfToken } = await $fetch<{ csrfToken: string }>("/api/auth/csrf")
console.log(_signInUrl)

View File

@@ -1,13 +1,14 @@
import { AuthHandler, AuthOptions, Session } from "@auth/core"
import { AuthConfig, Session } from "@auth/core/types"
import { Auth } from "@auth/core"
import { fromNodeMiddleware, H3Event } from "h3"
import getURL from "requrl"
import { createMiddleware } from "@hattip/adapter-node"
export function NuxtAuthHandler(options: AuthOptions) {
export function NuxtAuthHandler(options: AuthConfig) {
async function handler(ctx: { request: Request }) {
options.trustHost ??= true
return AuthHandler(ctx.request, options)
return Auth(ctx.request, options)
}
const middleware = createMiddleware(handler)
@@ -17,7 +18,7 @@ export function NuxtAuthHandler(options: AuthOptions) {
export async function getSession(
event: H3Event,
options: AuthOptions
options: AuthConfig
): Promise<Session | null> {
options.trustHost ??= true
@@ -30,7 +31,7 @@ export async function getSession(
nodeHeaders.append(key, headers[key] as any)
})
const response = await AuthHandler(
const response = await Auth(
new Request(url, { headers: nodeHeaders }),
options
)

View File

@@ -1,22 +1,21 @@
{
"name": "playground-nuxt",
"name": "next-auth-nuxt",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "export NODE_OPTIONS='--no-experimental-fetch' && nuxt dev",
"dev": "nuxt prepare && nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
"preview": "nuxt preview"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.1.1",
"eslint": "^8.29.0",
"h3": "1.0.2",
"nuxt": "3.0.0"
"h3": "1.6.6",
"nuxt": "3.5.1"
},
"dependencies": {
"@auth/core": "workspace:*",
"@hattip/adapter-node": "^0.0.22",
"@hattip/adapter-node": "^0.0.34",
"requrl": "^3.0.2"
}
}

View File

@@ -1,4 +1,4 @@
import { Session } from "@auth/core"
import { Session } from "@auth/core/types"
export default defineNuxtPlugin(async () => {
const session = useSession()

View File

@@ -1,10 +1,10 @@
import { NuxtAuthHandler } from "@/lib/auth/server"
import GithubProvider from "@auth/core/providers/github"
import type { AuthOptions } from "@auth/core"
import type { AuthConfig } from "@auth/core"
const runtimeConfig = useRuntimeConfig()
export const authOptions: AuthOptions = {
export const authOptions = {
secret: runtimeConfig.secret,
providers: [
GithubProvider({
@@ -12,6 +12,6 @@ export const authOptions: AuthOptions = {
clientSecret: runtimeConfig.github.clientSecret,
}),
],
}
} as AuthConfig
export default NuxtAuthHandler(authOptions)

View File

@@ -37,22 +37,31 @@ This documentation site is based on the [Docusaurus](https://docusaurus.io) fram
To start a local environment of this project, please do the following.
1. Clone the repository.
1. Clone the repo:
```bash
$ git clone https://github.com/nextauthjs/docs.git
```sh
git clone git@github.com:nextauthjs/next-auth.git
cd next-auth
```
2. Install dependencies
2. Set up the correct pnpm version, using [Corepack](https://nodejs.org/api/corepack.html). Run the following in the project'a root:
```bash
$ npm install
```sh
corepack enable pnpm
```
3. Start the development server
(Now, if you run `pnpm --version`, it should print the same verion as the `packageManager` property in the [`package.json` file](https://github.com/nextauthjs/next-auth/blob/main/package.json))
3. Install packages. Developing requires Node.js v18:
```sh
pnpm install
```
4. Start the development server
```bash
$ npm start
pnpm dev:docs
```
And thats all! Now you should have a local copy of this docs site running at [localhost:3000](http://localhost:3000)!

View File

@@ -7,7 +7,7 @@ title: Frequently Asked Questions
### Is Auth.js commercial software?
Auth.js is an open source project built by individual contributors.
Auth.js is an open-source project built by individual contributors.
It is not commercial software and is not associated with a commercial organization.
@@ -17,7 +17,7 @@ It is not commercial software and is not associated with a commercial organizati
<details>
<summary>
<h3 style={{display:"inline-block"}}>What databases does Auth.js support?</h3>
<h3 style={{display: "inline-block"}}>What databases does Auth.js support?</h3>
</summary>
<p>
@@ -30,7 +30,7 @@ You can use also Auth.js with any database using a custom database adapter, or b
<details>
<summary>
<h3 style={{display:"inline-block"}}>What authentication services does Auth.js support?</h3>
<h3 style={{display: "inline-block"}}>What authentication services does Auth.js support?</h3>
</summary>
<p>
@@ -38,16 +38,16 @@ You can use also Auth.js with any database using a custom database adapter, or b
(See also: <a href="/reference/providers/oauth-builtin">Providers</a>)
</p>
Auth.js also supports email for passwordless sign in, which is useful for account recovery or for people who are not able to use an account with the configured OAuth services (e.g. due to service outage, account suspension or otherwise becoming locked out of an account).
Auth.js also supports email for passwordless sign-in, which is useful for account recovery or for people who are not able to use an account with the configured OAuth services (e.g. due to service outage, account suspension or otherwise becoming locked out of an account).
You can also use a custom based provider to support signing in with a username and password stored in an external database and/or using two factor authentication.
You can also use a custom-based provider to support signing in with a username and password stored in an external database and/or using two-factor authentication.
</p>
</details>
<details>
<summary>
<h3 style={{display:"inline-block"}}>Does Auth.js support signing in with a username and password?</h3>
<h3 style={{display: "inline-block"}}>Does Auth.js support signing in with a username and password?</h3>
</summary>
<p>
@@ -55,44 +55,44 @@ Auth.js is designed to avoid the need to store passwords for user accounts.
If you have an existing database of usernames and passwords, you can use a custom credentials provider to allow signing in with a username and password stored in an existing database.
_If you use a custom credentials provider user accounts will not be persisted in a database by Auth.js (even if one is configured). The option to use JSON Web Tokens for session tokens (which allow sign in without using a session database) must be enabled to use a custom credentials provider._
_If you use a custom credentials provider user accounts will not be persisted in a database by Auth.js (even if one is configured). The option to use JSON Web Tokens for session tokens (which allow sign-in without using a session database) must be enabled to use a custom credentials provider._
</p>
</details>
<details>
<summary>
<h3 style={{display:"inline-block"}}>Can I use Auth.js with a website that does not use Next.js?</h3>
<h3 style={{display: "inline-block"}}>Can I use Auth.js with a website that does not use Next.js?</h3>
</summary>
<p>
Auth.js is designed for use with Next.js and Serverless.
If you are using a different framework for your website, you can create a website that handles sign in with Next.js and then access those sessions on a website that does not use Next.js as long as the websites are on the same domain.
If you are using a different framework for your website, you can create a website that handles sign-in with Next.js and then access those sessions on a website that does not use Next.js as long as the websites are on the same domain.
If you use Auth.js on a website with a different subdomain then the rest of your website (e.g. `auth.example.com` vs `www.example.com`) you will need to set a custom cookie domain policy for the Session Token cookie. (See also: [Cookies](/reference/configuration/auth-config#cookies))
If you use Auth.js on a website with a different subdomain than the rest of your website (e.g. `auth.example.com` vs `www.example.com`) you will need to set a custom cookie domain policy for the Session Token cookie. (See also: [Cookies](/reference/configuration/auth-config#cookies))
Auth.js does not currently support automatically signing into sites on different top level domains (e.g. `www.example.com` vs `www.example.org`) using a single session.
Auth.js does not currently support automatically signing into sites on different top-level domains (e.g. `www.example.com` vs `www.example.org`) using a single session.
</p>
</details>
<details>
<summary>
<h3 style={{display:"inline-block"}}>Can I use Auth.js with React Native?</h3>
<h3 style={{display: "inline-block"}}>Can I use Auth.js with React Native?</h3>
</summary>
<p>
Auth.js is designed as a secure, confidential client and implements a server side authentication flow.
Auth.js is designed as a secure, confidential client and implements a server-side authentication flow.
It is not intended to be used in native applications on desktop or mobile applications, which typically implement public clients (e.g. with client / secrets embedded in the application).
It is not intended to be used in native applications on desktop or mobile applications, which typically implement public clients (e.g. with client/secrets embedded in the application).
</p>
</details>
<details>
<summary>
<h3 style={{display:"inline-block"}}>Is Auth.js supporting TypeScript?</h3>
<h3 style={{display: "inline-block"}}>Is Auth.js supporting TypeScript?</h3>
</summary>
<p>
@@ -103,11 +103,11 @@ Yes! Check out the [TypeScript docs](/getting-started/typescript)
<details>
<summary>
<h3 style={{display:"inline-block"}}>Is Auth.js compatible with Next.js 12 Middleware?</h3>
<h3 style={{display: "inline-block"}}>Is Auth.js compatible with Next.js 12 Middleware?</h3>
</summary>
<p>
[Next.js Middleware](https://nextjs.org/docs/middleware) is supported. Head over to the [this page](/reference/nextjs/#middleware)
[Next.js Middleware](https://nextjs.org/docs/middleware) is supported. Head over to [this page](https://next-auth.js.org/configuration/nextjs#middleware)
</p>
</details>
@@ -118,7 +118,7 @@ Yes! Check out the [TypeScript docs](/getting-started/typescript)
<details>
<summary>
<h3 style={{display:"inline-block"}}>What databases are supported by Auth.js?</h3>
<h3 style={{display: "inline-block"}}>What databases are supported by Auth.js?</h3>
</summary>
<p>
@@ -131,13 +131,13 @@ It also provides an Adapter API which allows you to connect it to any database.
<details>
<summary>
<h3 style={{display:"inline-block"}}>What does Auth.js use databases for?</h3>
<h3 style={{display: "inline-block"}}>What does Auth.js use databases for?</h3>
</summary>
<p>
Databases in Auth.js are used for persisting users, OAuth accounts, email sign in tokens and sessions.
Databases in Auth.js are used for persisting users, OAuth accounts, email sign-in tokens and sessions.
Specifying a database is optional if you don't need to persist user data or support email sign in. If you don't specify a database then JSON Web Tokens will be enabled for session storage and used to store session data.
Specifying a database is optional if you don't need to persist user data or support email sign-in. If you don't specify a database then JSON Web Tokens will be enabled for session storage and used to store session data.
If you are using a database with Auth.js, you can still explicitly enable JSON Web Tokens for sessions (instead of using database sessions).
@@ -146,24 +146,24 @@ If you are using a database with Auth.js, you can still explicitly enable JSON W
<details>
<summary>
<h3 style={{display:"inline-block"}}>Should I use a database?</h3>
<h3 style={{display: "inline-block"}}>Should I use a database?</h3>
</summary>
<p>
- Using Auth.js without a database works well for internal tools - where you need to control who is able to sign in, but when you do not need to create user accounts for them in your application.
- Using Auth.js without a database works well for internal tools - where you need to control who can sign in, but when you do not need to create user accounts for them in your application.
- Using Auth.js with a database is usually a better approach for a consumer facing application where you need to persist accounts (e.g. for billing, to contact customers, etc).
- Using Auth.js with a database is usually a better approach for a consumer-facing application where you need to persist accounts (e.g. for billing, to contact customers, etc).
</p>
</details>
<details>
<summary>
<h3 style={{display:"inline-block"}}>What database should I use?</h3>
<h3 style={{display: "inline-block"}}>What database should I use?</h3>
</summary>
<p>
Managed database solutions for MySQL, Postgres and MongoDB (and compatible databases) are well supported from cloud providers such as Amazon, Google, Microsoft and Atlas.
Managed database solutions for MySQL, Postgres and MongoDB (and compatible databases) are well supported by cloud providers such as Amazon, Google, Microsoft and Atlas.
If you are deploying directly to a particular cloud platform you may also want to consider serverless database offerings they have (e.g. [Amazon Aurora Serverless on AWS](https://aws.amazon.com/rds/aurora/serverless/)).
@@ -174,51 +174,49 @@ If you are deploying directly to a particular cloud platform you may also want t
## Security
Parts of this section has been moved to its [own page](/getting-started/security).
Parts of this section have been moved to their [page](/security)](/security).
<details>
<summary>
<h3 style={{display:"inline-block"}}>How do I get Refresh Tokens and Access Tokens for an OAuth account?</h3>
<h3 style={{display: "inline-block"}}>How do I get Refresh Tokens and Access Tokens for an OAuth account?</h3>
</summary>
<p>
Auth.js provides a solution for authentication, session management and user account creation.
Auth.js records Refresh Tokens and Access Tokens on sign in (if supplied by the provider) and it will pass them, along with the User ID, Provider and Provider Account ID, to either:
Auth.js records Refresh Tokens and Access Tokens on sign-in (if supplied by the provider) and it will pass them, along with the User ID, Provider and Provider Account ID, to either:
1. A database - if a database connection string is provided
2. The JSON Web Token callback - if JWT sessions are enabled (e.g. if no database specified)
2. The JSON Web Token callback - if JWT sessions are enabled (e.g. if no database is specified)
You can then look them up from the database or persist them to the JSON Web Token.
Note: Auth.js does not currently handle Access Token rotation for OAuth providers for you, however you can check out [this tutorial](/guides/basics/refresh-token-rotation) if you want to implement it.
We also have an [example repository](https://github.com/nextauthjs/next-auth-refresh-token-example) / project based upon Auth.js v4 where we demonstrate how to use a refresh token to refresh the provided access token.
Note: Auth.js does not currently handle Access Token rotation for OAuth providers for you, however, you can check out [this tutorial](/guides/basics/refresh-token-rotation) if you want to implement it.
</p>
</details>
<details>
<summary>
<h3 style={{display:"inline-block"}}>When I sign in with another account with the same email address, why are accounts not linked automatically?</h3>
<h3 style={{display: "inline-block"}}>When I sign in with another account with the same email address, why are accounts not linked automatically?</h3>
</summary>
<p>
Automatic account linking on sign in is not secure between arbitrary providers - with the exception of allowing users to sign in via an email addresses as a fallback (as they must verify their email address as part of the flow).
Automatic account linking on sign-in is not secure between arbitrary providers - except for allowing users to sign in via email addresses as a fallback (as they must verify their email address as part of the flow).
When an email address is associated with an OAuth account it does not necessarily mean that it has been verified as belonging to account holder — how email address verification is handled is not part of the OAuth specification and varies between providers (e.g. some do not verify first, some do verify first, others return metadata indicating the verification status).
When an email address is associated with an OAuth account it does not necessarily mean that it has been verified as belonging to the account holder — how email address verification is handled is not part of the OAuth specification and varies between providers (e.g. some do not verify first, some do verify first, others return metadata indicating the verification status).
With automatic account linking on sign in, this can be exploited by bad actors to hijack accounts by creating an OAuth account associated with the email address of another user.
With automatic account linking on sign-in, this can be exploited by bad parties to hijack accounts by creating an OAuth account associated with the email address of another user.
For this reason it is not secure to automatically link accounts between arbitrary providers on sign in, which is why this feature is generally not provided by authentication service and is not provided by Auth.js.
For this reason, it is not secure to automatically link accounts between arbitrary providers on sign-in, which is why this feature is generally not provided by an authentication service and is not provided by Auth.js.
Automatic account linking is seen on some sites, sometimes insecurely. It can be technically possible to do automatic account linking securely if you trust all the providers involved to ensure they have securely verified the email address associated with the account, but requires placing trust (and transferring the risk) to those providers to handle the process securely.
Examples of scenarios where this is secure include with an OAuth provider you control (e.g. that only authorizes users internal to your organization) or with a provider you explicitly trust to have verified the users email address.
Examples of scenarios where this is secure include an OAuth provider you control (e.g. that only authorizes users internal to your organization) or a provider you explicitly trust to have verified the users' email address.
Automatic account linking is not a planned feature of Auth.js, however there is scope to improve the user experience of account linking and of handling this flow, in a secure way. Typically this involves providing a fallback option to sign in via email, which is already possible (and recommended), but the current implementation of this flow could be improved on.
Automatic account linking is not a planned feature of Auth.js, however, there is scope to improve the user experience of account linking and of handling this flow, securely. Typically this involves providing a fallback option to sign in via email, which is already possible (and recommended), but the current implementation of this flow could be improved.
Providing support for secure account linking and unlinking of additional providers - which can only be done if a user is already signed in already - was originally a feature in v1.x but has not been present since v2.0, is planned to return in a future release.
Providing support for secure account linking and unlinking of additional providers - which can only be done if a user is already signed in - was originally a feature in v1.x but has not been present since v2.0, and is planned to return in a future release.
</p>
</details>
@@ -229,11 +227,11 @@ Providing support for secure account linking and unlinking of additional provide
<details>
<summary>
<h3 style={{display:"inline-block"}}>Why doesn't Auth.js support [a particular feature]?</h3>
<h3 style={{display: "inline-block"}}>Why doesn't Auth.js support [a particular feature]?</h3>
</summary>
<p>
Auth.js is an open source project built by individual contributors who are volunteers writing code and providing support in their spare time.
Auth.js is an open-source project built by individual contributors who are volunteers writing code and providing support in their spare time.
If you would like Auth.js to support a particular feature, the best way to help make it happen is to raise a feature request describing the feature and offer to work with other contributors to develop and test it.
@@ -244,13 +242,13 @@ If you are not able to develop a feature yourself, you can offer to sponsor some
<details>
<summary>
<h3 style={{display:"inline-block"}}>I disagree with a design decision, how can I change your mind?</h3>
<h3 style={{display: "inline-block"}}>I disagree with a design decision, how can I change your mind?</h3>
</summary>
<p>
Product design decisions on Auth.js are made by core team members.
You can raise suggestions as feature requests / requests for enhancement.
You can raise suggestions as feature requests for enhancement.
Requests that provide the detail requested in the template and follow the format requested may be more likely to be supported, as additional detail prompted in the templates often provides important context.
@@ -269,7 +267,7 @@ Ultimately if your request is not accepted or is not actively in development, yo
</summary>
<p>
Auth.js by default uses JSON Web Tokens for saving the user's session. However, if you use a [database adapter](/guides/adapters/using-a-database-adapter), the database will be used to persist the user's session. You can force the usage of JWT when using a database [through the configuration options](/reference/configuration/auth-config#session). Since v4 all our JWT tokens are now encrypted by default with A256GCM.
Auth.js by default uses JSON Web Tokens for saving the user's session. However, if you use a [database adapter](/guides/adapters/using-a-database-adapter), the database will be used to persist the user's session. You can force the usage of JWT when using a database [through the configuration options](/reference/configuration/auth-config#session). Since v4 all our JWTs are now encrypted by default with A256GCM.
</p>
</details>
@@ -286,7 +284,7 @@ JSON Web Tokens can be used for session tokens, but are also used for lots of ot
- JSON Web Tokens in Auth.js are secured using cryptographic encryption (JWE) to store the included information directly in a JWT session token. You may then use the token to pass information between services and APIs on the same domain without having to contact a database to verify the included information.
- You can use JWT to securely store information you do not mind the client knowing even without encryption, as the JWT is stored in a server-readable-only cookie so data in the JWT is not accessible to third party JavaScript running on your site.
- You can use JWT to securely store information you do not mind the client knowing even without encryption, as the JWT is stored in a server-readable-only cookie so data in the JWT is not accessible to third-party JavaScript running on your site.
</p>
</details>
@@ -297,15 +295,15 @@ JSON Web Tokens can be used for session tokens, but are also used for lots of ot
</summary>
<p>
- You cannot as easily expire a JSON Web Token - doing so requires maintaining a server side blocklist of invalid tokens (at least until they expire) and checking every token against the list every time a token is presented.
- It's difficult to invalidate a JSON Web Token - doing so requires maintaining a server-side blocklist of the tokens (at least until they expire) and checking every token against the list every time a token is presented.
Shorter session expiry times are used when using JSON Web Tokens as session tokens to allow sessions to be invalidated sooner and simplify this problem.
Auth.js client includes advanced features to mitigate the downsides of using shorter session expiry times on the user experience, including automatic session token rotation, optionally sending keep alive messages to prevent short lived sessions from expiring if there is an window or tab open, background re-validation, and automatic tab/window syncing that keeps sessions in sync across windows any time session state changes or a window or tab gains or loses focus.
Auth.js client includes advanced features to mitigate the downsides of using shorter session expiry times on the user experience, including automatic session token rotation, optionally sending keep-alive messages to prevent short-lived sessions from expiring if there is a window or tab opened, background re-validation, and automatic tab/window syncing that keeps sessions in sync across windows any time session state changes or a window or tab gains or loses focus.
- As with database session tokens, JSON Web Tokens are limited in the amount of data you can store in them. There is typically a limit of around 4096 bytes per cookie, though the exact limit varies between browsers, proxies and hosting services. If you want to support most browsers, then do not exceed 4096 bytes per cookie. If you want to save more data, you will need to persist your sessions in a database (Source: [browsercookielimits.iain.guru](http://browsercookielimits.iain.guru/))
The more data you try to store in a token and the more other cookies you set, the closer you will come to this limit. Since v4 we have implemented cookie chunking so that cookies over the 4kb limit get split and reassembled upon parsing. However since this data needs to be transmitted on every request, if you wish to store more than ~4 KB of data you're probably at the point where you want to store a unique ID in the token and persist the data elsewhere (e.g. in a server-side key/value store).
The more data you try to store in a token and the more other cookies you set, the closer you will come to this limit. Auth.js uses cookie chunking so that cookies over the 4kb limit get split and reassembled upon parsing. However, since this data needs to be transmitted on every request, in case you wish to store more than ~4 KB of data you're probably at the point where you want to store a unique ID in the token and persist the data elsewhere (e.g. in a server-side key/value store).
- Data stored in an encrypted JSON Web Token (JWE) may be compromised at some point.
@@ -313,7 +311,7 @@ JSON Web Tokens can be used for session tokens, but are also used for lots of ot
Avoid storing any data in a token that might be problematic if it were to be decrypted in the future.
- If you do not explicitly specify a secret for for Auth.js, existing sessions will be invalidated any time your Auth.js configuration changes, as Auth.js will default to an auto-generated secret. Since v4 this only impacts development and generating a secret is required in production.
- If you do not explicitly specify a secret for Auth.js, existing sessions will be invalidated any time your Auth.js configuration changes, as Auth.js will default to an auto-generated secret. Since v4 this only impacts development and generating a secret is required in production.
</p>
</details>
@@ -324,12 +322,10 @@ JSON Web Tokens can be used for session tokens, but are also used for lots of ot
</summary>
<p>
By default tokens are not signed (JWS) but are encrypted (JWE). Since v4 we have implemented cookie chunking so that cookies over the 4kb limit get split and reassembled upon parsing.
By default, tokens are encrypted (JWE).
You can specify other valid algorithms - [as specified in RFC 7518](https://tools.ietf.org/html/rfc7517) - with either a secret (for symmetric encryption) or a public/private key pair (for asymmetric encryption).
Auth.js will generate keys for you, but this will generate a warning at start up.
Using explicit public/private keys for signing is strongly recommended.
</p>

View File

@@ -5,7 +5,7 @@ displayed_sidebar: null
## Core team
Without these people, the project could not have become one of the most used authentication library in its category.
Without these people, the project could not have become one of the most used authentication libraries in its category.
- [Balázs Orbán](https://github.com/balazsorban44) - **Lead Maintainer**
- [Thang Vu](https://github.com/ThangHuuVu) - Maintainer (Core)
@@ -14,8 +14,9 @@ Without these people, the project could not have become one of the most used aut
## Special thanks
Special thanks to Lori Karikari for creating most of the original provider configurations to Fredrik Pettersen for creating the original Prisma Adapter, to Gerald Nolan for adding support for Sign in with Apple, and to Jefferson Bledsoe for working on original testing automations.
Special thanks to Filip Skokan for their feedback and high-quality OAuth libraries that we build on, Lori Karikari for creating most of the original provider configurations, Fredrik Pettersen for creating the original Prisma Adapter, Gerald Nolan for adding support for Sign in with Apple, and Jefferson Bledsoe for working on original testing automation.
- [Filip Skokan](https://github.com/panva)
- [Lori Karikari](https://github.com/LoriKarikari)
- [Fredrik Pettersen](https://github.com/Fumler)
- [Gerald Nolan](https://github.com/geraldnolan)
@@ -25,7 +26,7 @@ Special thanks to Lori Karikari for creating most of the original provider confi
Auth.js as it exists today has been possible thanks to the work of many individual contributors.
Thank you to the [dozens of individual contributors](https://github.com/nextauthjs/next-auth/graphs/contributors) who have help shaped Auth.js.
Thank you to the [dozens of individual contributors](https://github.com/nextauthjs/next-auth/graphs/contributors) who have helped shape Auth.js.
## Open Collective
@@ -35,8 +36,10 @@ More information can be found at: https://opencollective.com/nextauth
## History
- Auth.js was originally developed by <a href="https://github.com/iaincollins">Iain Collins</a> in 2016 for Next.js.
- NextAuth.js was originally developed by <a href="https://github.com/iaincollins">Iain Collins</a> in 2016 for Next.js.
- In 2020, Auth.js was rebuilt from the ground up to support Serverless, with support for MySQL, Postgres and MongoDB, JSON Web Tokens and built in support for over a dozen authentication providers.
- In 2020, NextAuth.js was rebuilt from the ground up to support Serverless, with support for MySQL, Postgres and MongoDB, JSON Web Tokens and built-in support for over a dozen authentication providers.
- In 2021, efforts have started to move Auth.js to other frameworks and to support as many databases and providers as possible.
- In 2021, efforts have started to move NextAuth.js to other frameworks and to support as many databases and providers as possible.
- In 2022, Auth.js was born which separated the core authentication logic from the Next.js framework and added support for any new frameworks.

View File

@@ -1,56 +0,0 @@
---
title: Introduction
sidebar_position: 0
---
## About Auth.js
Auth.js is a complete open-source authentication solution for [Next.js](http://nextjs.org/) applications.
It is designed from the ground up to support Next.js and Serverless.
Check our tutorials to see how easy it is to use Auth.js for authentication:
- [Setup with OAuth](/getting-started/oauth-tutorial)
- [Setup with magic links](/getting-started/email-tutorial)
- [Integrating with external auth](/getting-started/credentials-tutorial)
### Flexible and easy to use
- Designed to work with any OAuth service, it supports OAuth 1.0, 1.0A, 2.0 and OpenID Connect
- Built-in support for [many popular sign-in services](/reference/providers/oauth-builtin)
- Supports [email / passwordless authentication](/getting-started/email-tutorial)
- Supports stateless authentication with [any backend](/getting-started/credentials-tutorial) (Active Directory, LDAP, etc)
- Supports both JSON Web Tokens and database sessions
- Designed for Serverless but runs anywhere (AWS Lambda, Docker, Heroku, etc…)
### Own your own data
Auth.js can be used with or without a database.
- An open-source solution that allows you to keep control of your data
- Supports Bring Your Own Database (BYOD) and can be used with any database
- Built-in support for [MySQL, MariaDB, Postgres, SQL Server, MongoDB and SQLite](/getting-started/databases)
- Works great with databases from popular hosting providers
- Can also be used _without a database_ (e.g. OAuth + JWT)
_Note: Email sign-in requires a database to be configured to store single-use verification tokens._
### Secure by default
- Promotes the use of passwordless sign-in mechanisms
- Designed to be secure by default and encourage best practices for safeguarding user data
- Uses Cross-Site Request Forgery Tokens on POST routes (sign in, sign out)
- Default cookie policy aims for the most restrictive policy appropriate for each cookie
- When JSON Web Tokens are enabled, they are encrypted by default (JWE) with A256GCM
- Auto-generates symmetric signing and encryption keys for developer convenience
- Features tab/window syncing and keepalive messages to support short-lived sessions
- Attempts to implement the latest guidance published by [Open Web Application Security Project](https://owasp.org/)
Advanced options allow you to define your own routines to handle controlling what accounts are allowed to sign in, for encoding and decoding JSON Web Tokens and to set custom cookie security policies and session properties, so you can control who can sign in and how often sessions have to be re-validated.
## Credits
Auth.js is an open-source project that is only possible [thanks to contributors](/contributors).
If you would like to financially support the development of Auth.js, you can find more information on our [OpenCollective](https://opencollective.com/nextauth) page.

View File

@@ -1,299 +0,0 @@
---
title: OAuth authentication
---
import creatingOauthAppImg from "./img/getting-started-creating-oauth-app.png"
import addingCallbackUrlImg from "./img/getting-started-oauth-callback-url.png"
import gettingClientIdSecretImg from "./img/getting-started-oauth-clientid-secret.png"
import startAppAndSignInImg from "./img/getting-started-app-start.png"
import githubAuthCredentials from "./img/getting-started-github-auth.png"
import nextAuthUserLoggedIn from "./img/getting-started-nextauth-success.png"
We know, authentication is hard. Is a rabbit hole and it's easy to get lost on it. The goal of making Auth.js is that you can add authentication easily to your project with just a few lines of code.
The easiest way is to setup Auth.js with an [OAuth](https://en.wikipedia.org/wiki/OAuth) provider. In this tutorial we'll be setting Auth.js in a **Next.js app** to be able to login with **Github**.
:::info
Auth.js comes with a long list of [built-in providers](/reference/providers/oauth-builtin) (Google, Facebook, Twitter, etc...) you can also integrate it with your own OAuth service easily by [building a custom provider](/guides/providers/custom-provider). Auth.js can integrate as well with other frameworks like SvelteKit, SolidStart and Gatsby.
:::
## 1. Configuring Auth.js
### Creating the server config
To add Auth.js to a [**Next.js**](https://nextjs.org/) project, create the following [API route](https://nextjs.org/docs/api-routes/introduction):
```
pages/api/auth/[...nextauth].ts
```
This route will contain the **dynamic route handler** for Auth.js which describes your global auth configuration:
```ts title="pages/api/auth/[...nextauth].js"
import NextAuth from "next-auth"
import GithubProvider from "next-auth/providers/github"
export default NextAuth({
providers: [
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
})
```
Behind the scenes this creates all the relevant OAuth API routes within `/api/auth/*` so that auth API requests to:
- `/api/auth/callback`
- `/api/auth/signIn`
- `/api/auth/signOut`
- etc...
can be handled by Auth.js. In this way, Auth.js stays in charge of handling the whole authentication request/response flow of your application for you.
You may notice there are some environment variables in the code example above. `GITHUB_ID` and `GITHUB_SECRET` are provided by the OAuth provider (in this case **Github**) see ["Configuring OAuth Provider"](/getting-started/oauth-tutorial#2-configuring-oauth-provider) section on how to get those.
`NEXTAUTH_SECRET` is a random string used by the library to encrypt tokens and email verification hashes, and **it's mandatory to keep things secure**! 🔥 🔐 . You can use:
```
$ openssl rand -base64 32
```
or https://generate-secret.vercel.app/32 to generate a random value for it.
:::info
Auth.js is extremely customizable, [our guides section](/guides/overview) will teach you how you can set it up to handle auth in different ways. All the possible configuration options are [listed here](/reference/configuration/auth-config).
:::
### Exposing the session via provider
To be able to use `useSession` first you'll need to expose the session context, [`<SessionProvider />`](/reference/react/#sessionprovider), at the top level of your application:
```ts title="pages/_app.ts"
import { SessionProvider } from "next-auth/react"
export default function App({
Component,
pageProps: { session, ...pageProps },
}) {
return (
<SessionProvider session={session}>
<Component {...pageProps} />
</SessionProvider>
)
}
```
Instances of `useSession` (more on it in the next section) will then have access to the session data and status. The `<SessionProvider />` also takes care of keeping the session updated and synced between browser tabs and windows. 💪🏽
:::tip
Check our [client docs](/reference/react/) to learn all the available options for handling sessions on the browser.
:::
### Consuming the session via hooks
Auth.js exposes a [`useSession()`](/reference/react/#usesession) React Hook so that you can easily check if someone is signed in:
```ts title="pages/overview.tsx"
import { useSession, signIn, signOut } from "next-auth/react"
export default function CamperVanPage() {
const { data: session, status } = useSession()
const userEmail = session?.user.email;
if (status === "loading") {
return <p>Hang on there...</p>
}
if (status === "authenticated") {
return (
<>
<p>Signed in as {userEmail}</p>
<button onClick={() => signOut()}>Sign out</button>
<img src="https://cdn.pixabay.com/photo/2017/08/11/19/36/vw-2632486_1280.png" />
</>
)
}
return (
<>
<p>Not signed in.</p>
<button onClick={() => signIn()}>Sign in</button>
</>
)
}
```
You can use the `useSession` hook from anywhere in your application (e.g. in a header component). Behind the scenes, the hook will connect to the `<SessionProvider />` to read the current user session.
### Protecting API Routes
Protecting your custom API Routes (.i.e not allowing a resource to be accessed in case the user is not logged in) is easy! You can use [`getSession()`](/reference/utilities/#getsession) to know whether a session exists or not:
```ts title="pages/api/movies/list.ts"
import { getSession } from "next-auth/react"
export default async function listMovies(req, res) {
const session = await getSession({ req })
if (session) {
res.send({
movies: [
{ title: "Alien vs Predator", id: 1 },
{ title: "Reservoir Dogs", id: 2 },
],
})
} else {
res.send({
error: "You must sign in to view movies.",
})
}
}
```
## 2. Configuring OAuth Provider
Ok, we have our Next.js app setup with NextAuth, however, if you run the app right now, it won't work as we haven't configured our OAuth provider (**Github**) yet.
:::info
When using OAuth you're asking for a third-party service (in this case Github, although it could be Google, Twitter, etc...) to handle user authentication for your app.
:::
We need to register our new Next.js app in Github, so that when Auth.js forwards the authorization requests to it, Github can recognize your application and prompt the user to sign in.
<img src={creatingOauthAppImg} />
Log in into **Github**, go to `Settings / Developers / OAuth Apps` and click on "New OAuth App".
Next you'll be presented with a screen to add details about your new application. Fill in the required fields, but pay extra attention to the **Authorization Callback URL** one:
<img src={addingCallbackUrlImg} />
The callback URL we insert should have the following pattern:
```
[origin]/api/auth/callback/[provider]
```
In this case, given we want to try our authentication working locally on our machine and we're using **Github** as our OAuth provider, it'll be:
```
http://localhost:3000/api/auth/callback/github
```
:::info
Auth.js will already magically create this API endpoint for you when we start the application later. Note that because we're using Next.js, locally it starts our server on the port `3000`, hence the origin is `http://localhost:3000`.
:::
Next you'll be presented with the following screen which presents all the configuration for your new OAuth app. For now, let's we need two things from it: the **Client ID** and **Client Secret** for our new OAuth app:
<img src={gettingClientIdSecretImg} />
The Client ID is always there, a public identifier of your OAuth application within Github. Click on the **Generate a new client Secret** button and should be presented with a new string (which is just a randomized string).
:::warning
🔥 Keep both your Client ID and Client Secret secure and never expose them to the public or shared with people outside your organization. With tem a malicious actor could hijack your application and cause you and your user serious problems!
:::
Now let's copy both the Client ID and Client Secret and paste them in an environment file in the root of your project like so:
```title=".env.local"
GITHUB_ID=12345
GITHUB_SECRET=67890
```
Cool! We have finished the configuring our OAuth provider, now let's wire all together so we can finally see authentication working in our app!
:::info
As noted previously, Auth.js has built-in support for multiple OAuth providers, <a href="">here the full list</a>. You can also easily build your own in case the provider you need is not on the list.
Note that, for each provider, the configuration process will be similar to what we just did:
1. Log in to the provider
2. Create create your OAuth application within it
3. Set the callback URL
4. Get the Client ID and Generate a Client Secret
:::
## 3. Wiring all together
Finally, we just need to reference our **Client ID** and **Client Secret** we just generated in the previous in our Auth.js config. In this way the library will be able to use them when forwarding users to Github, and Github will be able to recognize the request as generated from our application:
```ts title="pages/api/auth/[...nextauth].js"
import NextAuth from "next-auth"
import GithubProvider from "next-auth/providers/github"
export default NextAuth({
providers: [
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
})
```
Great! We're now ready to run our application locally. Start the Next.js app by running on your terminal the following command and navigating to [`http://localhost:3000`](http://localhost:3000):
```
$ npm run next dev
```
You should see the following page:
<img src={startAppAndSignInImg} />
Click on "Sign in" and then on "Sign in with Github": Auth.js will redirect you to Github, and Github will recognize our app [that we just registered](#2-configuring-oauth-provider) and ask the user (in this case you) to enter its credentials to proceed:
<img src={githubAuthCredentials} />
Once inserted and correct, Github will redirect the user to our app and Auth.js will take care of any further calls with Github to get access to the user profile and start a user sessions safely in the background:
<img src={nextAuthUserLoggedIn} />
Great! We have completed the whole E2E authentication flow setup so that users can login in our application through Github!
:::info
You can create your own Sign In page instead of using the default one from Auth.js. You can learn how to do so in our dedicated guide for it.
:::
## 4. Deploying to production
### Configuring different environments
It's normal to test your application under different environments. Usually you'll have a development environment (when you run the application locally in your machine), a staging environment (for teams members to try the application) and a production environment.
For each environment, you're going to need to create an OAuth application in your provider respectively, as [we did previously](#2-configuring-oauth-provider), and point the **callback URL** to it.
For instance in the previous section, we pointed the callback URL to:
```
http://localhost:3000/api/auth/callback/github
```
as we wanted to test our application in the development environment.
If we were to deploy our app to production, we would need to create again a new **OAuth App** in Github (calling it something like "Van life prod") and point the **callback URL** to our production domain:
```
https://example.com/api/auth/callback/github
```
Finally, we would need just to point the environment variables we set ( `GITHUB_ID` and `GITHUB_SECRET` ) to the credentials of the OAuth app we want our application to run against.
### Setting up `NEXTAUTH_URL`
When deploying your site, **you need to set** the `NEXTAUTH_URL` environment variable to the canonical URL of your website:
```
NEXTAUTH_URL=https://example.com
```
:::warning
In production, this needs to be set as an environment variable on the service you use to deploy your app.
To set environment variables on Vercel, you can use the [dashboard](https://vercel.com/dashboard) or the `vercel env pull` [command](https://vercel.com/docs/build-step#development-environment-variables).
:::
For more information please check out our [deployment page](/guides/basics/deployment).

View File

@@ -1,18 +0,0 @@
---
title: Databases
---
Auth.js offers multiple database adapters. Check our guides on:
- [using a database adapter](/guides/adapters/using-a-database-adapter)
- [creating your own](/guides/adapters/creating-a-database-adapter)
> As of **v4** Auth.js no longer ships with an adapter included by default. If you would like to persist any information, you need to install one of the many available adapters yourself. See the individual adapter documentation pages for more details.
To learn more about databases in Auth.js and how they are used, check out [databases in the FAQ](/concepts/faq#databases).
---
## How to use a database
See the [documentation for adapters](/reference/adapters/overview) for more information on advanced configuration, including how to use Auth.js with other databases using a [custom adapter](/guides/adapters/creating-a-database-adapter).

View File

@@ -2,6 +2,9 @@
title: Credentials authentication
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
Auth.js is built in a way that is flexible to integrate it with any authentication back-end you or your company may already have.
This library has been designed to handle the user session client-wise, to support multiple authentication methods (OAuth, Email, etc...) so that you're not forced to run your own authentication service.
@@ -16,37 +19,52 @@ The functionality provided for credentials based authentication is intentionally
Integrating the Credentials Provider is as simple as initializing it in the Auth.js configuration file:
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import CredentialsProvider from "next-auth/providers/credentials"
<Tabs groupId="frameworks" queryString>
<TabItem value="next" label="Next.js" default>
export default NextAuth({
providers: [
CredentialsProvider({
async authorize(credentials) {
const authResponse = await fetch("/users/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(credentials),
})
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import CredentialsProvider from "next-auth/providers/credentials"
if (!authResponse.ok) {
return null
}
export default NextAuth({
providers: [
CredentialsProvider({
async authorize(credentials) {
const authResponse = await fetch("/users/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(credentials),
})
const user = await authResponse.json()
if (!authResponse.ok) {
return null
}
return user
},
}),
],
})
```
const user = await authResponse.json()
return user
},
}),
],
})
```
</TabItem>
<TabItem value="sveltekit" label="SvelteKit">
TODO SvelteKit
</TabItem>
<TabItem value="solidstart" label="SolidStart">
TODO SolidStart
</TabItem>
<TabItem value="core" label="Vanilla (No Framework)">
TODO Core
</TabItem>
</Tabs>
:::note
Check the [Credentials Provider options](/reference/providers/credentials) for further customization
Check the [Credentials Provider options](/reference/core/providers_credentials) for further customization
:::
Note that we only need to define an `authorize` method that is in charge of receiving the credentials inserted by the user and call the authorization service.

View File

@@ -0,0 +1,14 @@
---
title: Databases
---
Auth.js offers multiple database adapters. Check our guides on:
- [Using a database adapter](/guides/adapters/using-a-database-adapter)
- [Creating your own](/guides/adapters/creating-a-database-adapter)
To learn more about databases in Auth.js and how they are used, check out [databases in the FAQ](/concepts/faq#databases).
## How to use a database
See the [documentation for adapters](/reference/adapters) for more information on advanced configuration, including how to use Auth.js with other databases using a [custom adapter](/guides/adapters/creating-a-database-adapter).

View File

@@ -7,6 +7,8 @@ import startPageImg from "./img/email-tutorial-start.png"
import checkPageImg from "./img/email-tutorial-check.png"
import mailboxImg from "./img/email-tutorial-mailbox.png"
import loggedInImg from "./img/email-tutorial-logged.png"
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
Aside from authenticating users in Auth.js via [OAuth](/getting-started/oauth-tutorial), you can also enable the option to authenticate them via "magic links". These are links that are sent to the user's email and when clicking on them they'll sign up the user automatically.
@@ -34,10 +36,10 @@ npm install -D nodemailer
## 2. Setting up a SMTP service
Next we need a [SMTP service](https://sendgrid.com/blog/what-is-an-smtp-server/) which will be in charge of sending emails from our application. There's a number of services available for this, however [here are the ones](http://nodemailer.com/smtp/well-known/) known to work with `nodemailer`.
Next we need a [SMTP service](https://sendgrid.com/blog/what-is-an-smtp-server/) which will be in charge of sending emails from our application. There's a number of services available for this, however [here are the ones](https://community.nodemailer.com/2-0-0-beta/setup-smtp/well-known-services) known to work with `nodemailer`.
:::info
For this tutorial, we're gonna be using [Sendgrid](https://sendgrid.com/), but any of the services linked above should work the same
For this tutorial, we're going to be using [Sendgrid](https://sendgrid.com/), but any of the services linked above should work the same
:::
First create an account in and then login to the dashboard, then navigate to "Settings → API Keys" and create an API key:
@@ -60,30 +62,47 @@ SMTP_PORT=587
EMAIL_FROM={SENDER_EMAIL}
```
Note that we're also specifying from which domain email are going to be sent from. You're gonna need to verify [a sender identity](https://docs.sendgrid.com/for-developers/sending-email/sender-identity) so that Sendgrid can send emails from your domain.
Note that we're also specifying from which domain email are going to be sent from. You're going to need to verify [a sender identity](https://docs.sendgrid.com/for-developers/sending-email/sender-identity) so that Sendgrid can send emails from your domain.
Nice! We're getting there. Now we need to read supply this values as the configuration for our Email Provider. Open `pages/api/auth/[...nextauth].ts` and do the following:
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import EmailProvider from "next-auth/providers/email"
<Tabs groupId="frameworks" queryString>
<TabItem value="next" label="Next.js" default>
export default NextAuth({
providers: [
Email({
server: {
host: process.env.EMAIL_SERVER_HOST,
port: Number(process.env.EMAIL_SERVER_PORT),
auth: {
user: process.env.EMAIL_SERVER_USER,
pass: process.env.EMAIL_SERVER_PASSWORD,
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import Email from "next-auth/providers/email"
export default NextAuth({
providers: [
Email({
server: {
host: process.env.SMTP_HOST,
port: Number(process.env.SMTP_PORT),
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
},
},
from: process.env.EMAIL_FROM,
}),
],
})
```
from: process.env.EMAIL_FROM,
}),
],
})
```
</TabItem>
<TabItem value="sveltekit" label="SvelteKit">
TODO SvelteKit
</TabItem>
<TabItem value="solidstart" label="SolidStart">
TODO SolidStart
</TabItem>
<TabItem value="core" label="Vanilla (No Framework)">
TODO Core
</TabItem>
</Tabs>
## 3. Setting up an adapter
@@ -91,12 +110,12 @@ Finally, we'll need to set up a database adapter to store verification tokens th
An **Adapter** in Auth.js connects your application to whatever database or backend system you want to use to store data for users, their accounts, sessions, etc...
For this tutorial, we're going to use the **MongoDB** adapter, other any of the other adapters will work just fine.
For this tutorial, we're going to use the **MongoDB** adapter, but any of the other adapters will work just fine.
First, let's start by installing the adapter package:
```bash npm2yarn2pnpm
npm install -D @next-auth/mongodb-adapter mongodb
npm install -D @auth/mongodb-adapter mongodb
```
and create a simple MongoDB client:
@@ -139,30 +158,46 @@ export default clientPromise
And now let's reference this new adapter from our Auth.js configuration file:
```diff title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import EmailProvider from "next-auth/providers/email"
+ import { MongoDBAdapter } from "@next-auth/mongodb-adapter"
+ import clientPromise from "../../../lib/mongodb/client"
<Tabs groupId="frameworks" queryString>
<TabItem value="next" label="Next.js" default>
```diff title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import EmailProvider from "next-auth/providers/email"
+ import { MongoDBAdapter } from "@auth/mongodb-adapter"
+ import clientPromise from "../../../lib/mongodb/client"
export default NextAuth({
secret: process.env.NEXTAUTH_SECRET,
+ adapter: MongoDBAdapter(clientPromise),
providers: [
EmailProvider({
server: {
host: process.env.EMAIL_SERVER_HOST,
port: process.env.EMAIL_SERVER_PORT,
auth: {
user: process.env.EMAIL_SERVER_USER,
pass: process.env.EMAIL_SERVER_PASSWORD
}
},
from: process.env.EMAIL_FROM
}),
],
})
```
</TabItem>
<TabItem value="sveltekit" label="SvelteKit">
TODO SvelteKit
</TabItem>
<TabItem value="solidstart" label="SolidStart">
TODO SolidStart
</TabItem>
<TabItem value="core" label="Vanilla (No Framework)">
TODO Core
</TabItem>
</Tabs>
export default NextAuth({
secret: process.env.NEXTAUTH_SECRET,
providers: [
+ adapter: MongoDBAdapter(clientPromise),
EmailProvider({
server: {
host: process.env.EMAIL_SERVER_HOST,
port: process.env.EMAIL_SERVER_PORT,
auth: {
user: process.env.EMAIL_SERVER_USER,
pass: process.env.EMAIL_SERVER_PASSWORD
}
},
from: process.env.EMAIL_FROM
}),
],
})
```
## 4. Wiring all together
@@ -170,7 +205,7 @@ Now that everything is properly configured, let's try to sign in via email on ou
Let's start by running a Next.js application with NextAuth, making sure the **EmailProvider** and a Database Adapter are properly configured as per the instructions above.
For this tutorial we're gonna be using NextAuth example app. Launch the app and click on "Sign in", we're redirected to the Sign In page:
For this tutorial we're going to be using NextAuth example app. Launch the app and click on "Sign in", we're redirected to the Sign In page:
<img src={startPageImg} alt="Screenshot of sign in page" />
@@ -188,7 +223,7 @@ Let's now check our email, and look for one sent from NextAuth (check your spam
<img src={mailboxImg} alt="Screenshot of mailbox" />
Nice! We got one, coming from the sender specified in the `EMAIL_FROM` environment variable from our configuration above and that's is the sender we verified in Sengrid.
Nice! We got one, coming from the sender specified in the `EMAIL_FROM` environment variable from our configuration above and that's is the sender we verified in Sendgrid.
Click on "Sign in" and a new browser tab will open, you should then land on your application as authenticated!

View File

@@ -0,0 +1,44 @@
---
title: Introduction
sidebar_position: 0
---
## About Auth.js
Auth.js is a complete open-source authentication solution for web applications. Check out the live demos of Auth.js in action:
- [Next.js](https://next-auth-example.vercel.app/)
- [SvelteKit](https://sveltekit-auth-example.vercel.app/)
- [SolidStart](https://auth-solid.vercel.app/)
Continue to our tutorials to see how to use Auth.js for authentication:
- [Setup with OAuth](/getting-started/oauth-tutorial)
- [Setup with magic links](/getting-started/email-tutorial)
- [Integrating with external auth](/getting-started/credentials-tutorial)
### Features
- Built in support for 60+ popular services (Google, Facebook, Auth0, Apple…)
- Built-in email/password-less/magic link
- Use with any OAuth 2 or OpenID Connect provider
- Use with any username/password store
### Flexible
- Runtime agnostic - run anywhere! Vercel Edge Functions, Node.js, Serverless, etc.
- Use with any modern framework! Next.js, SolidStart, SvelteKit, etc.
- [Bring Your Own Database](/getting-started/databases) - or none! MySQL, Postgres, MSSQL, MongoDB, etc. Choose database sessions or JWT.
_Note: Email sign-in requires a database to store single-use verification tokens._
### Secure by default
- Signed, prefixed, server-only cookies
- Built-in CSRF protection
- Doesn't rely on client-side JavaScript
- JWT with JWS / JWE / JWK.
## Credits
Auth.js is an open-source project that is only possible [thanks to contributors](/contributors).
To financially support the development of Auth.js, you can check our [OpenCollective](https://opencollective.com/nextauth) page. We appreciate your support 💚.

View File

@@ -0,0 +1,506 @@
---
title: OAuth authentication
---
import creatingOauthAppImg from "./img/getting-started-creating-oauth-app.png"
import addingCallbackUrlImg from "./img/getting-started-oauth-callback-url.png"
import gettingClientIdSecretImg from "./img/getting-started-oauth-clientid-secret.png"
import startAppAndSignInImg from "./img/getting-started-app-start.png"
import githubAuthCredentials from "./img/getting-started-github-auth.png"
import nextAuthUserLoggedIn from "./img/getting-started-nextauth-success.png"
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
The goal of Auth.js is that you can add authentication easily to your project with just a few lines of code.
The fastest way to set up Auth.js is with an [OAuth](/concepts/oauth) provider. In this tutorial, we'll be setting Auth.js in a web application to be able to log in with **GitHub**.
:::info
Auth.js comes with a list of [built-in providers](/reference/providers/oauth-builtin) (Google, Facebook, Twitter, etc.). You can also integrate it with your OAuth service by [building a custom provider](/guides/providers/custom-provider).
:::
## 1. Configuring Auth.js
To add Auth.js to your project:
<Tabs groupId="frameworks" queryString>
<TabItem value="next" label="Next.js" default>
### Prerequisites
This tutorial assumes you have a Next.js application set up. If you don't, you can follow the [Next.js tutorial](https://nextjs.org/learn/basics/create-nextjs-app) to get started.
### Installing NextAuth.js
```bash npm2yarn
npm install next-auth
```
### Creating the server config
Create the following [API route](https://nextjs.org/docs/api-routes/dynamic-api-routes#catch-all-api-routes) file. This route contains the necessary configuration for NextAuth.js, as well as the dynamic route handler:
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import GithubProvider from "next-auth/providers/github"
export default NextAuth({
providers: [
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
})
```
:::info
Behind the scenes, this creates all the relevant OAuth API routes within `/api/auth/*` so that auth API requests to:
- [GET `/api/auth/signin`](https://authjs.dev/reference/rest-api#get--apiauthsignin)
- [POST `/api/auth/signin/:provider`](https://authjs.dev/reference/rest-api#post--apiauthsigninprovider)
- [GET/POST `/api/auth/callback/:provider`](https://authjs.dev/reference/rest-api#get--post--apiauthcallbackprovider)
- [GET `/api/auth/signout`](https://authjs.dev/reference/rest-api#get--apiauthsignout)
- [POST `/api/auth/signout`](https://authjs.dev/reference/rest-api#post--apiauthsignout)
- [GET `/api/auth/session`](https://authjs.dev/reference/rest-api#get--apiauthsession)
- [GET `/api/auth/csrf`](https://authjs.dev/reference/rest-api#get--apiauthcsrf)
- [GET `/api/auth/providers`](https://authjs.dev/reference/rest-api#get--apiauthproviders)
can be handled by NextAuth.js. In this way, NextAuth.js stays in charge of the whole application's authentication request/response flow.
NextAuth.js is fully customizable - [our guides section](/guides/overview) teaches you how to set it up to handle auth in different ways. All the possible configuration options are [listed here](/reference/configuration/auth-config).
:::
### Adding environment variables
You may notice we are using environment variables in the code example above. We take the value of `GITHUB_ID` and `GITHUB_SECRET` from the GitHub Developer OAuth Portal. See [Configuring OAuth Provider](/getting-started/oauth-tutorial#2-configuring-oauth-provider) section on how to get those.
In your project root, create a `.env.local` file and add the `NEXTAUTH_SECRET` environment variable:
```title=".env.local"
NEXTAUTH_SECRET="This is an example"
```
`NEXTAUTH_SECRET` is a random string used by the library to encrypt tokens and email verification hashes, and **it's mandatory to keep things secure**! 🔥 🔐 . You can use:
```
openssl rand -base64 32
```
or https://generate-secret.vercel.app/32 to generate a random value for it.
### Exposing the session via `SessionProvider`:
NextAuth.js provides [`useSession()`](/reference/react/#usesession) - a [React Hooks](https://reactjs.org/docs/hooks-intro.html) to access the session data and status. To use it first you'll need to expose the session context - [`<SessionProvider />`](/reference/react/#sessionprovider) - at the top level of your application:
```ts title="pages/_app.tsx"
import { SessionProvider } from "next-auth/react"
import type { AppProps } from "next/app"
export default function App({
Component,
pageProps: { session, ...pageProps },
}: AppProps) {
return (
<SessionProvider session={session}>
<Component {...pageProps} />
</SessionProvider>
)
}
```
Instances of `useSession` (more on it in the next section) will have access to the session data and status. The `<SessionProvider />` also keep the session updated and synced between browser tabs and windows. 💪🏽
:::tip
Check our [client docs](/reference/react/) to learn all the available options for handling sessions on the browser.
:::
### Consuming the session via hooks
You can use the `useSession` hook from anywhere in your application (E.g. in a header component). Behind the scenes, the hook will connect to the `<SessionProvider />` to read the current user session. Learn more about React Context in the [React docs](https://reactjs.org/docs/context.html).
```ts title="pages/overview.tsx"
import { useSession, signIn, signOut } from "next-auth/react"
export default function CamperVanPage() {
const { data: session, status } = useSession()
const userEmail = session?.user?.email
if (status === "loading") {
return <p>Hang on there...</p>
}
if (status === "authenticated") {
return (
<>
<p>Signed in as {userEmail}</p>
<button onClick={() => signOut()}>Sign out</button>
<img src="https://cdn.pixabay.com/photo/2017/08/11/19/36/vw-2632486_1280.png" />
</>
)
}
return (
<>
<p>Not signed in.</p>
<button onClick={() => signIn("github")}>Sign in</button>
</>
)
}
```
### Protecting API Routes
To protect your API Routes (blocking unauthorized access to resources), you can use [`getServerSession()`](https://next-auth.js.org/configuration/nextjs#getserversession) to know whether a session exists or not:
```ts title="pages/api/movies/list.ts"
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
export default async function listMovies(req, res) {
const session = await getServerSession(req, res, authOptions)
if (session) {
res.send({
movies: [
{ title: "Alien vs Predator", id: 1 },
{ title: "Reservoir Dogs", id: 2 },
],
})
} else {
res.send({
error: "You must sign in to view movies.",
})
}
}
```
</TabItem>
<TabItem value="sveltekit" label="SvelteKit">
:::warning
`@auth/sveltekit` is currently experimental. The API _will_ change in the future.
:::
### Prerequisites
This tutorial assumes you have a SvelteKit application set up. If you don't, you can follow the [SvelteKit tutorial](https://kit.svelte.dev/docs/creating-a-project) to get started.
### Installing Auth.js
```bash npm2yarn
npm install @auth/core @auth/sveltekit
```
### Create server hook
Create the following [Server hook](https://kit.svelte.dev/docs/hooks) file. This route contains the necessary configuration for Auth.js, as well as the dynamic route handler:
```ts title="src/hooks.server.ts"
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 })],
})
```
:::info
Behind the scenes, this creates all the relevant OAuth API routes within `/api/auth/*` so that auth API requests to:
- [GET `/api/auth/signin`](https://authjs.dev/reference/rest-api#get--apiauthsignin)
- [POST `/api/auth/signin/:provider`](https://authjs.dev/reference/rest-api#post--apiauthsigninprovider)
- [GET/POST `/api/auth/callback/:provider`](https://authjs.dev/reference/rest-api#get--post--apiauthcallbackprovider)
- [GET `/api/auth/signout`](https://authjs.dev/reference/rest-api#get--apiauthsignout)
- [POST `/api/auth/signout`](https://authjs.dev/reference/rest-api#post--apiauthsignout)
- [GET `/api/auth/session`](https://authjs.dev/reference/rest-api#get--apiauthsession)
- [GET `/api/auth/csrf`](https://authjs.dev/reference/rest-api#get--apiauthcsrf)
- [GET `/api/auth/providers`](https://authjs.dev/reference/rest-api#get--apiauthproviders)
can be handled by Auth.js. In this way, Auth.js stays in charge of the whole application's authentication request/response flow.
Auth.js is fully customizable - [our guides section](/guides/overview) teaches you how to set it up to handle auth in different ways. All the possible configuration options are [listed here](/reference/configuration/auth-config).
:::
### Adding environment variables
You may notice we are using environment variables in the code example above. We take the value of `GITHUB_ID` and `GITHUB_SECRET` from the GitHub Developer OAuth Portal. See [Configuring OAuth Provider](/getting-started/oauth-tutorial#2-configuring-oauth-provider) section on how to get those.
In your project root, create a `.env.local` file and add the `AUTH_SECRET` environment variable:
```title=".env.local"
AUTH_SECRET="This is an example"
```
`AUTH_SECRET` is a random string used by the library to encrypt tokens and email verification hashes, and **it's mandatory to keep things secure**! 🔥 🔐 . You can use:
```
openssl rand -base64 32
```
or https://generate-secret.vercel.app/32 to generate a random value for it.
### Exposing the session via page store
Auth.js provides us a getSession, function to access the session data and status, to call from the `event.locals` variable. We can now just call it and add it to our `$page` store.
```ts
import type { LayoutServerLoad } from './$types';
*
export const load: LayoutServerLoad = async (event) => {
return {
session: await event.locals.getSession()
};
};
```
### Consuming the session via page store
You can use the `$page.data.session` variable from anywhere on your page. Learn more about SvelteKit's page store in the [SvelteKit docs](https://learn.svelte.dev/tutorial/page-store).
```ts title="route/+page.svelte"
<script>
import { signIn, signOut } from '@auth/sveltekit/client'
import { page } from '$app/stores'
</script>
{#if $page.data.session?.user}
<p>Signed in as {$page.data.session.user.email}</p>
<button on:click={signOut}>Sign out</button>
<img src="https://cdn.pixabay.com/photo/2017/08/11/19/36/vw-2632486_1280.png" />
{:else}
<p>Not signed in.</p>
<button on:click={() => signIn('github')}>Sign in</button>
{/if}
```
### Protecting API Routes
To protect your API Routes (blocking unauthorized access to resources), you can use `locals.getSessions()` just like in the layouts file to know whether a session exists or not:
```ts title="routes/api/movies/+server.ts"
import { json, error } from "@sveltejs/kit"
import type { RequestEvent } from "./$types"
export async function GET({ locals }: RequestEvent) {
const session = await locals.getSession()
if (!session?.user) {
throw error(401, "You must sign in to view movies.")
}
return json({
movies: [
{ title: "Alien vs Predator", id: 1 },
{ title: "Reservoir Dogs", id: 2 },
],
})
}
```
</TabItem>
<TabItem value="solidstart" label="SolidStart">
TODO: SolidStart
</TabItem>
<TabItem value="core" label="Vanilla (No Framework)">
TODO Core
</TabItem>
</Tabs>
## 2. Configuring OAuth Provider
Ok, we have our app set up with NextAuth.js, however, if you run the app right now, it won't work as we haven't configured our OAuth provider (**GitHub**) yet.
:::info
When using OAuth you're asking for a third-party service (in this case GitHub, although it could be Google, Twitter, etc...) to handle user authentication for your app.
:::
We need to register our new app in GitHub, so that when NextAuth.js forwards the authorization requests to it, GitHub can recognize your application and prompt the user to sign in.
<img src={creatingOauthAppImg} />
Log in to **GitHub**, go to [`Settings / Developers / OAuth Apps`](https://github.com/settings/developers) and click "New OAuth App"
Next, you'll be presented with a screen to add details about your new application. Fill in the required fields, but pay extra attention to the **Authorization Callback URL** one:
<img src={addingCallbackUrlImg} />
The callback URL we insert should have the following pattern:
```
[origin]/api/auth/callback/[provider]
```
In this case, given we want to try our authentication working locally on our machine and we're using **GitHub** as our OAuth provider, it'll be:
<Tabs groupId="frameworks" queryString>
<TabItem value="next" label="Next.js" default>
```
http://localhost:3000/api/auth/callback/github
```
:::info
NextAuth.js will already create this API endpoint for you when we start the application later. Note that because we're using Next.js, locally it starts our server on port `3000` by default. Hence, the origin is `http://localhost:3000`.
:::
</TabItem>
<TabItem value="sveltekit" label="SvelteKit">
```
http://localhost:5173/auth/callback/github
```
</TabItem>
<TabItem value="solidstart" label="SolidStart">
TODO SolidStart
</TabItem>
<TabItem value="core" label="Vanilla (No Framework)">
TODO Core
</TabItem>
</Tabs>
:::info
The last part of the URL, `[provider]`, is the ID of the provider you're using. In this case, we're using GitHub, so it's `github`. If you're using Google, it'll be `google`, etc... We keep track of the provider IDs internally.
The same id is used in the `signIn()` method we saw earlier.
:::
To register, tap on "Register application" button.
The next screen shows all the configurations for your newly created OAuth app. For now, we need two things from it - the **Client ID** and **Client Secret**:
<img src={gettingClientIdSecretImg} />
The Client ID is always there, a public identifier of your OAuth application within GitHub. Click on the **Generate a new client Secret** button and should be presented with a new string (which is just a randomized string).
:::warning
Keep both your Client ID and Client Secret secure and never expose them to the public or share them with people outside your organization. With them, a malicious actor could hijack your application and cause you and your user serious problems!
:::
Cool! We have finished configuring our OAuth provider, now let's wire all together so we can finally see authentication working in our app!
:::info
As noted previously, NextAuth.js has built-in support for multiple OAuth providers, <a href="">here is the full list</a>. You can also easily build your own in case the provider you need is not on the list.
Note that, for each provider, the configuration process will be similar to what we just did:
1. Log in to the provider
2. Create create your OAuth application within it
3. Set the callback URL
4. Get the Client ID and Generate a Client Secret
:::
## 3. Wiring all together
Finally, we just need to reference our **Client ID** and **Client Secret** we just generated in the previous in our Auth.js config. In this way, the library will be able to use them when forwarding users to GitHub, and GitHub will be able to recognize the request as generated from our application.
Now let's copy both the Client ID and Client Secret and paste them into an environment file in the root of your project like so:
```title=".env.local"
GITHUB_ID=12345
GITHUB_SECRET=67890
```
Here is our server configuration file again:
<Tabs groupId="frameworks" queryString>
<TabItem value="next" label="Next.js" default>
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
import GithubProvider from "next-auth/providers/github"
export default NextAuth({
providers: [
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
})
```
Great! We're now ready to run our application locally. Start the Next.js app by running on your terminal the following command and navigating to [`http://localhost:3000`](http://localhost:3000):
```
npm run next dev
```
</TabItem>
<TabItem value="sveltekit" label="SvelteKit">
```ts title="src/hooks.server.ts"
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 })],
})
```
Great! We're now ready to run our application locally. Start the Svelte app by running on your terminal the following command and navigating to [`http://localhost:5173`](http://localhost:5173):
```
npm run vite dev
```
</TabItem>
<TabItem value="solidstart" label="SolidStart">
TODO SolidStart
</TabItem>
<TabItem value="core" label="Vanilla (No Framework)">
TODO Core
</TabItem>
</Tabs>
You should see the following page:
<img src={startAppAndSignInImg} />
Click on "Sign in" and then on "Sign in with GitHub": Auth.js will redirect you to GitHub, and GitHub will recognize our app [that we just registered](#2-configuring-oauth-provider) and ask the user (in this case you) to enter its credentials to proceed:
<img src={githubAuthCredentials} />
Once inserted and correct, GitHub will redirect the user to our app and NextAuth.js will take care of any further calls with GitHub to get access to the user profile and start a user session safely in the background:
<img src={nextAuthUserLoggedIn} />
Great! We have completed the whole E2E authentication flow setup so that users can log in to our application through GitHub!
## 4. Deploying to production
### Configuring different environments
It's normal to test your application in different environments. Usually, you'll have a development environment (when you run the application locally on your machine), a staging environment (for team members to try the application), and a production environment.
For each environment, you need to create an OAuth application in your provider respectively, as [we did previously](#2-configuring-oauth-provider), and point the **callback URL** to it.
For instance, in the previous section, we pointed the callback URL to `http://localhost:3000/api/auth/callback/github` as we wanted to test our application in the development environment.
If we were to deploy our app to production, we would need to create a new **OAuth App** in GitHub (calling it something like "Van life prod") and point the **callback URL** to our production domain: `https://example.com/api/auth/callback/github`
Finally, we would need to point the environment variables we set ( `GITHUB_ID` and `GITHUB_SECRET` ) to the credentials of the OAuth app we want our application to run with.
### Setting up `NEXTAUTH_URL`
:::tip
Skip this section if you are deploying to Vercel.
:::
When deploying your site, **you need to set** the `NEXTAUTH_URL` environment variable to the canonical URL of your website:
```
NEXTAUTH_URL=https://example.com
```
:::warning
In production, this needs to be set as an environment variable on the service you use to deploy your app.
To set environment variables on Vercel, you can use the [dashboard](https://vercel.com/dashboard) or the `vercel env pull` [command](https://vercel.com/docs/build-step#development-environment-variables).
:::
For more information please check out our [deployment page](/guides/basics/deployment).

View File

@@ -5,10 +5,13 @@ title: TypeScript
Auth.js has its own type definitions to use in your TypeScript projects safely. Even if you don't use TypeScript, IDEs like VSCode will pick this up to provide you with a better developer experience. While you are typing, you will get suggestions about what certain objects/functions look like, and sometimes links to documentation, examples, and other valuable resources.
Check out the example repository showcasing how to use `next-auth` on a Next.js application with TypeScript:
https://github.com/nextauthjs/next-auth-typescript-example
https://github.com/nextauthjs/next-auth-example
---
import Tabs from "@theme/Tabs"
import TabItem from "@theme/TabItem"
## Adapters
If you're writing your own custom Adapter, you can take advantage of the types to make sure your implementation conforms to what's expected:
@@ -46,30 +49,45 @@ This will work in code editors with a strong TypeScript integration like VSCode
Let's look at `Session`:
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
<Tabs groupId="frameworks" queryString>
<TabItem value="next" label="Next.js" default>
export default NextAuth({
callbacks: {
session({ session, token, user }) {
return session // The return type will match the one returned in `useSession()`
```ts title="pages/api/auth/[...nextauth].ts"
import NextAuth from "next-auth"
export default NextAuth({
callbacks: {
session({ session, token, user }) {
return session // The return type will match the one returned in `useSession()`
},
},
},
})
```
})
```
```ts title="pages/index.ts"
import { useSession } from "next-auth/react"
```ts title="pages/index.ts"
import { useSession } from "next-auth/react"
export default function IndexPage() {
// `session` will match the returned value of `callbacks.session()` from `NextAuth()`
const { data: session } = useSession()
export default function IndexPage() {
// `session` will match the returned value of `callbacks.session()` from `NextAuth()`
const { data: session } = useSession()
return (
// Your component
)
}
```
return (
// Your component
)
}
```
</TabItem>
<TabItem value="sveltekit" label="SvelteKit">
TODO SvelteKit
</TabItem>
<TabItem value="solidstart" label="SolidStart">
TODO SolidStart
</TabItem>
<TabItem value="core" label="Vanilla (No Framework)">
TODO Core
</TabItem>
</Tabs>
To extend/augment this type, create a `types/next-auth.d.ts` file in your project:

View File

@@ -239,7 +239,7 @@ Introduced in https://github.com/nextauthjs/next-auth/releases/tag/v4.0.0-next.1
## `nodemailer`
Like `typeorm` and `prisma`, [`nodemailer`](https://npmjs.com/package/nodemailer) is no longer included as a dependency by default. If you are using the Email provider you must install it in your project manually, or use any other Email library in the [`sendVerificationRequest`](/reference/providers/email) callback. This reduces bundle size for those not actually using the Email provider. Remember, when using the Email provider, it is mandatory to also use a database adapter due to the fact that verification tokens need to be persisted longer term for the magic link functionality to work.
Like `typeorm` and `prisma`, [`nodemailer`](https://npmjs.com/package/nodemailer) is no longer included as a dependency by default. If you are using the Email provider you must install it in your project manually, or use any other Email library in the [`sendVerificationRequest`](/guides/providers/email) callback. This reduces bundle size for those not actually using the Email provider. Remember, when using the Email provider, it is mandatory to also use a database adapter due to the fact that verification tokens need to be persisted longer term for the magic link functionality to work.
Introduced in https://github.com/nextauthjs/next-auth/releases/tag/v4.0.0-next.2
@@ -580,7 +580,7 @@ Auth.js used to generate a secret for convenience, when the user did not define
You can generate a secret to be placed in the `secret` configuration option via the following command:
```bash
$ openssl rand -base64 32
openssl rand -base64 32
```
Therefore, your Auth.js config should look something like this:

View File

@@ -1,94 +0,0 @@
---
title: Deployment
---
Deploying Auth.js only requires a few steps. It can be run anywhere a Next.js application can. Therefore, in a default configuration using only JWT session strategy, i.e. without a database, you will only need these few things in addition to your application:
1. Auth.js environment variables
- `NEXTAUTH_SECRET`
- `NEXTAUTH_URL`
2. Auth.js API Route and its configuration (`/pages/api/auth/[...nextauth].js`).
- OAuth Provider `clientId` / `clientSecret`
Deploying a modern JavaScript application using Auth.js consists of making sure your environment variables are set correctly as well as the configuration in the Auth.js API route is setup, as well as any configuration (like Callback URLs, etc.) are correctly done in your OAuth provider(s) themselves.
See below for more detailed provider settings.
## Vercel
1. Make sure to expose the Vercel [System Environment Variables](https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables) in your project settings.
2. Create a `NEXTAUTH_SECRET` environment variable for all environments.
a. You can use `openssl rand -base64 32` or https://generate-secret.vercel.app/32 to generate a random value.
b. You **do not** need the `NEXTAUTH_URL` environment variable in Vercel.
3. Add your provider's client ID and client secret to environment variables. _(Skip this step if not using an [OAuth Provider](/reference/providers/index))_
4. Deploy!
Example repository: https://github.com/nextauthjs/next-auth-example
A few notes about deploying to Vercel. The environment variables are read server-side, so you do not need to prefix them with `NEXT_PUBLIC_`. When deploying here, you do not need to explicitly set the `NEXTAUTH_URL` environment variable. With other providers **you will** need to also set this environment variable.
### Securing a preview deployment
Securing a preview deployment (with an OAuth provider) comes with some critical obstacles. Most OAuth providers only allow a single redirect/callback URL, or at least a set of full static URLs. Meaning you cannot set the value before publishing the site and you cannot use wildcard subdomains in the callback URL settings of your OAuth provider. Here are a few ways you can still use Auth.js to secure your Preview Deployments.
#### Using the Credentials Provider
You could check in your `/pages/api/auth/[...nextauth].js` API route / configuration file to see if you're currently in a Vercel preview environment, and if so, enable a simple "credential provider", meaning username/password. Vercel offers a few built-in [system environment variables](https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables) which you could check against, like `VERCEL_ENV`. This would allow you to use this basic, for testing only, authentication strategy in your preview deployments.
Some things to be aware of here, include:
- Do not let this potential testing-only user have access to any critical data
- If possible, maybe do not even connect this preview deployment to your production database
##### Example
```js title="/pages/api/auth/[...nextauth].js"
import NextAuth from "next-auth"
import GoogleProvider from "next-auth/providers/google"
import CredentialsProvider from "next-auth/providers/credentials"
export default NextAuth({
providers: [
process.env.VERCEL_ENV === "preview"
? CredentialsProvider({
name: "Credentials",
credentials: {
username: {
label: "Username",
type: "text",
placeholder: "jsmith",
},
password: { label: "Password", type: "password" },
},
async authorize() {
return {
id: 1,
name: "J Smith",
email: "jsmith@example.com",
image: "https://i.pravatar.cc/150?u=jsmith@example.com",
}
},
})
: GoogleProvider({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
],
})
```
#### Using the branch based preview URL
Preview deployments at Vercel are often available via multiple URLs. For example, PR's merged to `master` or `main`, will be available the commit and PR specific preview URLs, but also the branch specific preview URLs. This branch specific URL will obviously not change as long as you work with that same branch. Therefore, you could add to your OAuth provider your `{project}-git-main-{user}.vercel.app` preview URL. As this will stay constant for that branch, you can reuse that preview deployment / URL for testing any authentication related deployments.
## Netlify
Netlify is very similar to Vercel in that you can deploy a Next.js project without almost any extra work.
In order to setup Auth.js correctly here, you will want to make sure you add your `NEXTAUTH_SECRET` environment variable in the project settings. If you are using the [Essential Next.js Build Plugin](https://github.com/netlify/netlify-plugin-nextjs) within your project, you **do not** need to set the `NEXTAUTH_URL` environment variable as it is set automatically as part of the build process.
Netlify also exposes some [system environment variables](https://docs.netlify.com/configure-builds/environment-variables/) from which you can check which `NODE_ENV` you are currently in and much more.
After this, just make sure you either have your OAuth provider setup correctly with `clientId` / `clientSecret`'s and callback URLs.

View File

@@ -1,136 +0,0 @@
---
title: Refresh token rotation
---
While Auth.js doesn't automatically handle access token rotation for [OAuth providers](/reference/providers/oauth-builtin) yet, this functionality can be implemented using [callbacks](/guides/basics/callbacks).
## Source Code
A working example can be accessed [here](https://github.com/nextauthjs/next-auth-refresh-token-example).
## Implementation
### Server Side
Using a [JWT callback](https://authjs.dev/guides/basics/callbacks#jwt-callback) and a [session callback](https://authjs.dev/guides/basics/callbacks#session-callback), we can persist OAuth tokens and refresh them when they expire.
Below is a sample implementation using Google's Identity Provider. Please note that the OAuth 2.0 request in the `refreshAccessToken()` function will vary between different providers, but the core logic should remain similar.
```js title="pages/api/auth/[...nextauth].js"
import NextAuth from "next-auth"
import GoogleProvider from "next-auth/providers/google"
const GOOGLE_AUTHORIZATION_URL =
"https://accounts.google.com/o/oauth2/v2/auth?" +
new URLSearchParams({
prompt: "consent",
access_type: "offline",
response_type: "code",
})
/**
* Takes a token, and returns a new token with updated
* `accessToken` and `accessTokenExpires`. If an error occurs,
* returns the old token and an error property
*/
async function refreshAccessToken(token) {
try {
const url =
"https://oauth2.googleapis.com/token?" +
new URLSearchParams({
client_id: process.env.GOOGLE_CLIENT_ID,
client_secret: process.env.GOOGLE_CLIENT_SECRET,
grant_type: "refresh_token",
refresh_token: token.refreshToken,
})
const response = await fetch(url, {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
method: "POST",
})
const refreshedTokens = await response.json()
if (!response.ok) {
throw refreshedTokens
}
return {
...token,
accessToken: refreshedTokens.access_token,
accessTokenExpires: Date.now() + refreshedTokens.expires_at * 1000,
refreshToken: refreshedTokens.refresh_token ?? token.refreshToken, // Fall back to old refresh token
}
} catch (error) {
console.log(error)
return {
...token,
error: "RefreshAccessTokenError",
}
}
}
export default NextAuth({
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
authorization: GOOGLE_AUTHORIZATION_URL,
}),
],
callbacks: {
async jwt({ token, user, account }) {
// Initial sign in
if (account && user) {
return {
accessToken: account.access_token,
accessTokenExpires: Date.now() + account.expires_at * 1000,
refreshToken: account.refresh_token,
user,
}
}
// Return previous token if the access token has not expired yet
if (Date.now() < token.accessTokenExpires) {
return token
}
// Access token has expired, try to update it
return refreshAccessToken(token)
},
async session({ session, token }) {
session.user = token.user
session.accessToken = token.accessToken
session.error = token.error
return session
},
},
})
```
### Client Side
The `RefreshAccessTokenError` error that is caught in the `refreshAccessToken()` method is passed all the way to the client. This means that you can direct the user to the sign in flow if we cannot refresh their token.
We can handle this functionality as a side effect:
```js title="pages/home.js"
import { signIn, useSession } from "next-auth/react";
import { useEffect } from "react";
const HomePage() {
const { data: session } = useSession();
useEffect(() => {
if (session?.error === "RefreshAccessTokenError") {
signIn(); // Force sign in to hopefully resolve error
}
}, [session]);
return (...)
}
```

View File

@@ -1,64 +0,0 @@
---
title: Role based logins
---
To add role based authentication to your application, you must do three things.
1. Update your database schema
2. Add the `role` to the session object
3. Check for `role` in your pages/components
First modify the `user` table and add a `role` column with the type of `String?`.
Below is an example Prisma schema file.
```javascript title="/prisma/schema.prisma"
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
role String? // New Column
accounts Account[]
sessions Session[]
}
```
Next, implement a custom session callback in the `[...nextauth].js` file, as shown below.
```javascript title="/pages/api/auth/[...nextauth].js"
callbacks: {
async session({ session, token, user }) {
session.user.role = user.role; // Add role value to user object so it is passed along with session
return session;
},
```
Going forward, when using the `getSession` hook, check that `session.user.role` matches the required role. The example below assumes the role `'admin'` is required.
```javascript title="/pages/admin.js"
import { getSession } from "next-auth/react"
export default function Page() {
const session = await getSession({ req })
if (session && session.user.role === "admin") {
return (
<div>
<h1>Admin</h1>
<p>Welcome to the Admin Portal!</p>
</div>
)
} else {
return (
<div>
<h1>You are not authorized to view this page!</h1>
</div>
)
}
}
```
Then it is up to you how you manage your roles, either through direct database access or building your own role update API.

View File

@@ -1,136 +0,0 @@
---
title: Using a custom Provider
sidebar_label: Creating a Provider
---
You can use an OAuth provider that isn't built-in by using a custom object.
As an example of what this looks like, this is the provider object returned for the Google provider:
```js
{
id: "google",
name: "Google",
type: "oauth",
wellKnown: "https://accounts.google.com/.well-known/openid-configuration",
authorization: { params: { scope: "openid email profile" } },
idToken: true,
checks: ["pkce", "state"],
profile(profile) {
return {
id: profile.sub,
name: profile.name,
email: profile.email,
image: profile.picture,
}
},
}
```
As you can see, if your provider supports OpenID Connect and the `/.well-known/openid-configuration` endpoint contains support for the `grant_type`: `authorization_code`, you only need to pass the URL to that configuration file and define some basic fields like `name` and `type`.
Otherwise, you can pass a more full set of URLs for each OAuth2.0 flow step, for example:
```js
{
id: "kakao",
name: "Kakao",
type: "oauth",
authorization: "https://kauth.kakao.com/oauth/authorize",
token: "https://kauth.kakao.com/oauth/token",
userinfo: "https://kapi.kakao.com/v2/user/me",
profile(profile) {
return {
id: profile.id,
name: profile.kakao_account?.profile.nickname,
email: profile.kakao_account?.email,
image: profile.kakao_account?.profile.profile_image_url,
}
},
}
```
Replace all the options in this JSON object with the ones from your custom provider - be sure to give it a unique ID and specify the required URLs, and finally add it to the providers array when initializing the library:
```js title="pages/api/auth/[...nextauth].js"
import TwitterProvider from "next-auth/providers/twitter"
...
providers: [
TwitterProvider({
clientId: process.env.TWITTER_ID,
clientSecret: process.env.TWITTER_SECRET,
}),
{
id: 'customProvider',
name: 'CustomProvider',
type: 'oauth',
scope: '' // Make sure to request the users email address
...
}
]
...
```
### Override default options
For built-in providers, in most cases you will only need to specify the `clientId` and `clientSecret`. If you need to override any of the defaults, add your own [options](#options).
Even if you are using a built-in provider, you can override any of these options to tweak the default configuration.
:::note
The user provided options are deeply merged with the default options. That means you only have to override part of the options that you need to be different. For example if you want different scopes, overriding `authorization.params.scope` is enough, instead of the whole `authorization` option.
:::
```js title=/api/auth/[...nextauth].js
import Auth0Provider from "next-auth/providers/auth0"
Auth0Provider({
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
issuer: process.env.ISSUER,
authorization: { params: { scope: "openid your_custom_scope" } },
})
```
Another example, the `profile` callback will return `id`, `name`, `email` and `picture` by default, but you might need more information from the provider. After setting the correct scopes, you can then do something like this:
```js title=/api/auth/[...nextauth].js
import GoogleProvider from "next-auth/providers/google"
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
profile(profile) {
return {
// Return all the profile information you need.
// The only truly required field is `id`
// to be able identify the account when added to a database
}
},
})
```
An example of how to enable automatic account linking:
```js title=/api/auth/[...nextauth].js
import GoogleProvider from "next-auth/providers/google"
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
allowDangerousEmailAccountLinking: true,
})
```
### Adding a new built-in provider
If you think your custom provider might be useful to others, we encourage you to open a PR and add it to the built-in list so others can discover it much more easily!
You only need to add three changes:
1. Add your config: [`src/providers/{provider}.ts`](https://github.com/nextauthjs/next-auth/tree/main/packages/next-auth/src/providers)<br />
- Make sure you use a named default export, like this: `export default function YourProvider`
- Add two SVG's of the provider logo, like `google-dark.svg` (dark mode) and `google.svg` (light mode), to the `/packages/next-auth/provider-logos/` directory as well as the styling config to the provider config object. See existing provider for example
2. Add provider documentation: [`docs/docs/reference/05-oauth-providers/{provider}.md`](https://github.com/nextauthjs/next-auth/tree/main/docs/docs/reference/05-oauth-providers)
3. Add the new provider name to the `Provider type` dropdown options in [`the provider issue template`](https://github.com/nextauthjs/next-auth/edit/main/.github/ISSUE_TEMPLATE/2_bug_provider.yml)
That's it! 🎉 Others will be able to discover and use this provider much more easily now!

View File

@@ -1,5 +0,0 @@
{
"label": "Other",
"collapsible": true,
"collapsed": true
}

View File

@@ -1,79 +0,0 @@
---
title: LDAP Authentication
---
Auth.js provides the ability to setup a [custom Credential provider](/guides/providers/credentials) which we can take advantage of to authenticate users against an existing LDAP server.
You will need an additional dependency, `ldapjs`, which you can install by running
```bash npm2yarn2pnpm
npm install ldapjs
```
Then you must setup the `CredentialsProvider()` provider key like so:
```js title="[...nextauth].js"
const ldap = require("ldapjs")
import NextAuth from "next-auth"
import CredentialsProvider from "next-auth/providers/credentials"
export default NextAuth({
providers: [
CredentialsProvider({
name: "LDAP",
credentials: {
username: { label: "DN", type: "text", placeholder: "" },
password: { label: "Password", type: "password" },
},
async authorize(credentials, req) {
// You might want to pull this call out so we're not making a new LDAP client on every login attemp
const client = ldap.createClient({
url: process.env.LDAP_URI,
})
// Essentially promisify the LDAPJS client.bind function
return new Promise((resolve, reject) => {
client.bind(credentials.username, credentials.password, (error) => {
if (error) {
console.error("Failed")
reject()
} else {
console.log("Logged in")
resolve({
username: credentials.username,
password: credentials.password,
})
}
})
})
},
}),
],
callbacks: {
async jwt({ token, user }) {
const isSignIn = user ? true : false
if (isSignIn) {
token.username = user.username
token.password = user.password
}
return token
},
async session({ session, token }) {
return { ...session, user: { username: token.username } }
},
},
})
```
The idea is that once one is authenticated with the LDAP server, one can pass through both the username/DN and password to the JWT stored in the browser.
This is then passed back to any API routes and retrieved as such:
```js title="/pages/api/doLDAPWork.js"
token = await jwt.getToken({
req,
})
const { username, password } = token
```
> Thanks to [Winwardo](https://github.com/Winwardo) for the code example

View File

@@ -1,60 +0,0 @@
---
title: Usage with class components
---
If you want to use the [`useSession()`](/reference/react/#usesession) hook in your class components you can do so with the help of a higher order component or with a render prop.
## Higher Order Component
```js
import { useSession } from "next-auth/react"
const withSession = (Component) => (props) => {
const session = useSession()
// if the component has a render property, we are good
if (Component.prototype.render) {
return <Component session={session} {...props} />
}
// if the passed component is a function component, there is no need for this wrapper
throw new Error(
[
"You passed a function component, `withSession` is not needed.",
"You can `useSession` directly in your component.",
].join("\n")
)
}
// Usage
class ClassComponent extends React.Component {
render() {
const { data: session, status } = this.props.session
return null
}
}
const ClassComponentWithSession = withSession(ClassComponent)
```
## Render Prop
```js
import { useSession } from "next-auth/react"
const UseSession = ({ children }) => {
const session = useSession()
return children(session)
}
// Usage
class ClassComponent extends React.Component {
render() {
return (
<UseSession>
{(session) => <pre>{JSON.stringify(session, null, 2)}</pre>}
</UseSession>
)
}
}
```

View File

@@ -2,19 +2,16 @@
title: Creating a database adapter
---
Using a custom adapter you can connect to any database back-end or even several different databases. Official adapters created and maintained by our community can be found in the [adapters](https://github.com/nextauthjs/next-auth/tree/main/packages) packages. Feel free to add a custom adapter from your project to the repository, or even become a maintainer of a certain adapter. Custom adapters can still be created and used in a project without being added to the repository.
Custom adapters allow you to integrate with any (even multiple) database/back-end service, even if we don't have an [official package](https://github.com/nextauthjs/next-auth/tree/main/packages) available yet. The only requirement is that your database can support the [models](/reference/adapters#models) that Auth.js expects.
## How to create an adapter
For more information about the data these methods need to manage see [models](/reference/adapters/models).
_See the code below for practical example._
_See the code below for a practical example._
### Example code
```ts
/** @return { import("next-auth/adapters").Adapter } */
export default function MyAdapter(client, options = {}) {
import type { Adapter } from '@auth/core/adapters'
export function MyAdapter(client, options = {}): Adapter {
return {
async createUser(user) {
return
@@ -64,7 +61,7 @@ export default function MyAdapter(client, options = {}) {
### Required methods
These methods are required for all sign in flows:
These methods are required for all sign-in flows:
- `createUser`
- `getUser`
@@ -77,7 +74,7 @@ These methods are required for all sign in flows:
- `deleteSession`
- `updateUser`
These methods are required to support email / passwordless sign in:
These methods are required to support email / passwordless sign-in:
- `createVerificationToken`
- `useVerificationToken`
@@ -88,3 +85,8 @@ These methods will be required in a future release, but are not yet invoked:
- `deleteUser`
- `unlinkAccount`
### Useful resources
- [Official adapters' source code](https://github.com/nextauthjs/next-auth/tree/main/packages)
- [`Adapter` interface](/reference/core/adapters#adapter)

View File

@@ -2,12 +2,12 @@
title: Using a database adapter
---
An **Adapter** in Auth.js connects your application to whatever database or backend system you want to use to store data for users, their accounts, sessions, etc. Adapters are optional, unless you need to persist user information in your own database, or you want to implement certain flows. The [Email Provider](/getting-started/email-tutorial) requires an adapter to be able to save [Verification Tokens](/reference/adapters/models#verification-token).
An **Adapter** in Auth.js connects your application to whatever database or backend system you want to use to store data for users, their accounts, sessions, etc. Adapters are optional, unless you need to persist user information in your own database, or you want to implement certain flows. The [Email Provider](/getting-started/email-tutorial) requires an adapter to be able to save [Verification Tokens](/reference/adapters#verification-token).
:::tip
When using a database, you can still use JWT for session handling for fast access. See the [`session.strategy`](/reference/configuration/auth-config#session) option. Read about the trade-offs of JWT in the [FAQ](/concepts/faq#json-web-tokens).
:::
We have a list of official adapters that are distributed as their own packages under the `@next-auth/{name}-adapter` namespace. Their source code is available in their various adapters package directories at [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth/tree/main/packages):
We have a list of official adapters that are distributed as their own packages under the `@auth/{name}-adapter` namespace. Their source code is available in their various adapters package directories at [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth/tree/main/packages):
- [All available adapters](/reference/adapters/overview)
- [All available adapters](/reference/adapters)

View File

@@ -1,5 +1,5 @@
{
"label": "Basics",
"collapsible": true,
"collapsed": true
"collapsed": false
}

View File

@@ -12,7 +12,7 @@ If you want to pass data such as an Access Token or User ID to the browser when
You can specify a handler for any of the callbacks below.
```js title="pages/api/auth/[...nextauth].js"s
```js title="auth.js"
callbacks: {
async signIn({ user, account, profile, email, credentials }) {
return true
@@ -35,7 +35,7 @@ The documentation below shows how to implement each callback, their default beha
Use the `signIn()` callback to control if a user is allowed to sign in.
```js title="pages/api/auth/[...nextauth].js"
```js title="auth.js"
callbacks: {
async signIn({ user, account, profile, email, credentials }) {
const isAllowedToSignIn = true
@@ -79,7 +79,7 @@ By default only URLs on the same URL as the site are allowed, you can use the re
The default redirect callback looks like this:
```js title="pages/api/auth/[...nextauth].js"
```js title="auth.js"
callbacks: {
async redirect({ url, baseUrl }) {
// Allows relative callback URLs
@@ -107,7 +107,7 @@ Requests to `/api/auth/signin`, `/api/auth/session` and calls to `getSession()`,
The contents _user_, _account_, _profile_ and _isNewUser_ will vary depending on the provider and on if you are using a database or not. You can persist data such as User ID, OAuth Access Token in this token. To make it available in the browser, check out the [`session()` callback](#session-callback) as well.
```js title="pages/api/auth/[...nextauth].js"
```js title="auth.js"
callbacks: {
async jwt({ token, account }) {
// Persist the OAuth access_token to the token right after signin
@@ -132,7 +132,7 @@ e.g. `getSession()`, `useSession()`, `/api/auth/session`
- When using database sessions, the User object is passed as an argument.
- When using JSON Web Tokens for sessions, the JWT payload is provided instead.
```js title="pages/api/auth/[...nextauth].js"
```js title="auth.js"
callbacks: {
async session({ session, token, user }) {
// Send properties to the client, like an access_token from a provider.

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