Compare commits

..

2321 Commits

Author SHA1 Message Date
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
Cameron Downey
d2288ee4cc fix(docs): turn SvelteKitAuth to named import in code example (#6250) 2023-01-02 10:52:47 +00:00
Thang Vu
5a6f76bf2c fix: docs build (#6253)
* fix: docs build

* chore: move next-auth output to dist

* chore: add next-auth as deps for doc

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

This reverts commit 9596a9134e6de4f4bd8dcfaa6d3002e98863d8f8.

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

* Add missing DynamoDBClientConfig interface import

* Add missing installation requirements

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

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

* chore(docs): image file and size optimizations

* chore(docs): fix semantic misordered headings

* chore(docs): make banner link more descriptive

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

* solidstart docs

* Update 02-oauth-tutorial.mdx

* minor docs fixes

* Fix sidebar typo

* Update sync.yml

* Update sidebars.js

* minor fixes

* fix deps

* upgrade auth example

* Update root.tsx

* Update NavBar.tsx

* Update Protected.tsx

* protected

* move example

* Update sidebars.js

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

* use MissingSecret error instead

* had wrong import

* change in core

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

* update in core

* birthday single word

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

Change description to reflect that JWT is encrypted by default

* update in core

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

* chore: move to /examples

* chore: move to playgrounds, add dev/sveltekit

* Update sync.yml

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

* chore: gitignore generated styles.ts

* chore: gitignore generated styles.ts

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

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

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

* Apply suggestions from code review

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

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

* Replaced the Contributing Guide broken link in README
2022-12-26 19:38:33 +01:00
Thang Vu
511f66b0a8 chore: enable remote caching for GH actions (#6187) 2022-12-26 11:38:30 +00:00
Thang Vu
ae57199258 chore(examples): unify /protected path behavior for Sveltekit and N… (#6176)
chore(examples): unify `/protected` path behavior for Sveltekit and Next.js
2022-12-25 17:56:10 +07:00
Balázs Orbán
aad425fced docs: show property types 2022-12-25 09:53:53 +01:00
Balázs Orbán
8ef1010bb1 chore: attempt to fix supabase test
SUPABASE_SERVICE_ROLE_KEY could be an empty string
2022-12-25 06:38:29 +01:00
Balázs Orbán
950ca3169a chore: make supabase wget quite 2022-12-25 06:30:03 +01:00
Balázs Orbán
edbf0fc011 chore: revert concurrency 2022-12-25 06:19:20 +01:00
Balázs Orbán
46bac818fe chore: add concurrency to tests 2022-12-25 06:15:48 +01:00
Balázs Orbán
9e64eb0cdd chore: simplify turbo config 2022-12-25 06:15:27 +01:00
Balázs Orbán
955e379330 chore: format 2022-12-25 05:59:12 +01:00
Balázs Orbán
7be4461253 chore: don't minify output CSS 2022-12-25 05:58:43 +01:00
Balázs Orbán
c2e06dc445 chore: upgrade oauth4webapi 2022-12-25 05:58:08 +01:00
Balázs Orbán
4dd70a5f6f fix(ts): enable strict type checking 2022-12-25 05:55:25 +01:00
Balázs Orbán
98dbf56494 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-12-25 05:19:32 +01:00
Balázs Orbán
6b4644f7e7 chore(adapters): refactor Supabase Adapter test 2022-12-25 05:18:53 +01:00
GitHub Actions
bcf909b69e chore(release): bump package version(s) [skip ci] 2022-12-24 16:39:23 +00:00
Balázs Orbán
4dcdd21242 fix(providers): add state check to Twitter by default
Fixes #6135
2022-12-24 17:16:22 +01:00
Balázs Orbán
137d993a13 chore(dev): upgrade next 2022-12-24 17:15:35 +01:00
Balázs Orbán
8dda662cd6 chore: fix issue validator path 2022-12-24 16:43:51 +01:00
Balázs Orbán
8a438bab32 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-12-24 16:36:33 +01:00
Balázs Orbán
4aaad03e9c chore: fix issue validator 2022-12-24 16:36:30 +01:00
Fatih Aygün
4fa0d1fa2a fix(core): correctly normalize endpoint configuration (#6173) 2022-12-24 15:31:47 +00:00
Balázs Orbán
c081773667 chore: use classic PAT for example sync 2022-12-24 15:25:57 +00:00
Balázs Orbán
1ab0a2aed4 fix(adapters): correct peer dependency for Supabase Adapter
Fixes #6172
2022-12-24 15:23:29 +00:00
Balázs Orbán
cac9816d32 chore: update sync examples PAT 2022-12-24 15:19:27 +00:00
Balázs Orbán
65defc709e chore(examples): change to named import 2022-12-24 15:14:06 +00:00
Balázs Orbán
1601626d31 chore: prettier ignore generated file 2022-12-24 04:34:47 +01:00
Balázs Orbán
8c4f439279 fix: add package keywords 2022-12-24 04:32:10 +01:00
GitHub Actions
a3cc9cb5f8 chore(release): bump package version(s) [skip ci] 2022-12-24 03:15:11 +00:00
Balázs Orbán
0ad4be2809 fix(core): add header to README 2022-12-24 04:04:56 +01:00
Balázs Orbán
aea4aaf25f fix(sveltekit): add header to README 2022-12-24 04:04:49 +01:00
Balázs Orbán
9bd7bc8a47 chore: fix docs building 2022-12-24 03:43:32 +01:00
Balázs Orbán
bf8fc9ca94 chore: fix docs scripts 2022-12-24 03:39:57 +01:00
Balázs Orbán
7116248e87 chore: mark @auth/* as prereleases 2022-12-24 03:30:53 +01:00
Balázs Orbán
ef8f353d94 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-12-24 03:26:10 +01:00
Balázs Orbán
01620f9b7c chore: drop older node.js versions, update pnpm 2022-12-24 03:26:07 +01:00
Balázs Orbán
87d41aff94 chore: re-add LICENSE as it seems to not be picked up 2022-12-24 02:22:29 +00:00
Balázs Orbán
2d21f5ea5e chore: remove LICENSE file in favor of .github
See: https://github.com/nextauthjs/.github
2022-12-24 02:21:52 +00:00
Balázs Orbán
adf7cae7a0 chore: gitignore eslintcache 2022-12-24 03:17:50 +01:00
Balázs Orbán
f9b75e0a39 chore: remove extra tsconfigs 2022-12-24 03:16:50 +01:00
Balázs Orbán
9d6f54539d chore: simplify eslint linting 2022-12-24 03:10:03 +01:00
Balázs Orbán
0e51c66e11 chore: remove package-level lint and format 2022-12-24 01:49:31 +01:00
Balázs Orbán
e47c3c81f1 chore: format 2022-12-24 01:47:46 +01:00
Balázs Orbán
d69edb8501 chore: tweak prettierignore 2022-12-24 01:46:17 +01:00
Balázs Orbán
e5c0e3513b chore: upgrade monorepo-release package 2022-12-24 01:33:50 +01:00
Balázs Orbán
ca208ce732 chore: remove husky 2022-12-24 01:33:20 +01:00
Balázs Orbán
dcb601987b Merge branch 'main' of github.com:nextauthjs/next-auth 2022-12-23 15:00:20 +01:00
Balázs Orbán
7fd799a9ac chore: only lint with prettier 2022-12-23 15:00:13 +01:00
Balázs Orbán
fdd5e2390d chore: format 2022-12-23 14:42:37 +01:00
Balázs Orbán
fdecbb59c4 chore: move all lint/format to top 2022-12-23 14:41:53 +01:00
Nico Domino
677d8a346f chore(docs): fix aloglia docusaurus.config.js settings (#6159)
* chore: fix docusaurus algolia config

* chore: add empty 03-core dir
2022-12-23 12:41:43 +01:00
GitHub Actions
aad0b8db0e chore(release): bump package version(s) [skip ci] 2022-12-23 06:16:36 +00:00
Balázs Orbán
137bbb8d84 fix(core): improve AuthConfig docs 2022-12-23 07:02:50 +01:00
Balázs Orbán
d7fbd05eba chore: update monorepo-release package 2022-12-23 06:52:57 +01:00
Balázs Orbán
532aa24495 chore: use classic PAT for now 2022-12-23 05:10:27 +01:00
github-actions
f5da5a5f33 chore(release): bump package version(s) [skip ci] 2022-12-23 04:31:30 +01:00
Balázs Orbán
3b85f46c21 Update release.yml 2022-12-23 04:11:44 +01:00
Balázs Orbán
6aa1af2ffb Update release.yml 2022-12-23 04:11:00 +01:00
Balázs Orbán
9364625681 Update release.yml 2022-12-23 04:09:30 +01:00
Balázs Orbán
1bf2e1d468 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-12-23 03:58:39 +01:00
Balázs Orbán
ac304f17da docs: fix link to sveltekit 2022-12-23 03:58:35 +01:00
Balázs Orbán
3a685b28f8 Update release.yml 2022-12-23 02:56:15 +00:00
Balázs Orbán
5b34b95c58 Update release.yml 2022-12-23 02:42:21 +00:00
Balázs Orbán
a706105205 chore: skip dynamodb as it times out 2022-12-23 03:28:07 +01:00
Balázs Orbán
39c78f27b5 fix(sveltekit): update to latest @auth/core, autogenerate API reference (#6153)
* docs(sveltekit): autogenerate API reference

* feat(sveltekit): update to use latest `@auth/core`

* chore: format

* chore: add auth packages as docs dependency

* chore: format

* chore: more formatting

* chore: don't run build before tests
2022-12-23 02:17:24 +00:00
Balázs Orbán
b179f15cf3 chore: tweak release config 2022-12-23 01:49:04 +01:00
Jordan Calhoun
54561a1231 docs: Typo correction (#6151)
PROT -> PORT
2022-12-22 22:42:56 +00:00
Nico Domino
0ea9ada3a9 chore(docs): remaining authjs.dev and repo clean up (#6097) 2022-12-22 18:04:52 +01:00
Nico Domino
209c368a73 chore(docs): add adapters and providers subdomain redirect in vercel.json (#6146) 2022-12-22 17:40:22 +01:00
Nico Domino
52c5b7cad3 chore(docs): update auth.js og-image (#6145) 2022-12-22 17:36:28 +01:00
Balázs Orbán
b8d83f52b3 chore(examples): attempt to fix gatsby deployment 2022-12-22 05:42:26 +01:00
Balázs Orbán
7dacfbabf0 chore(examples): attempt to fix gatsby deployment 2022-12-22 04:41:20 +01:00
Balázs Orbán
bb372cc5cc docs: main page improvements 2022-12-22 04:05:22 +01:00
Unieveth
c6ca01a99e docs: fix closing tag on oauth-tutorial (#6134)
Fixed wrong closing tag on oauth-tutorial

Changed closing tag on pages/overview.tsx from `</img>` to `</>
2022-12-22 02:37:36 +00:00
Balázs Orbán
6c45abf383 feat(core): improved logging / renames / new exports (#6085)
- Cleans up logging. Logs are now color-coded, added more debug logs, and errors can include some simple metadata (like provider id) to know which provider caused an issue.
- All errors are exposed via `@auth/core/errors`. Each error has a URL like: https://errors.authjs.dev#errorcode in the terminal, which points to the documentation explaining the problem in detail, suggesting a fix.
- Added a bunch of documentation that autogenerates the pages under https://authjs.dev/reference/core/modules/main
- Renames `AuthHandler`  to `Auth` and `AuthOptions` to `AuthConfig`
- Throwing an error in `signIn` callback will now be caught as a general error and will redirect to `/error?error=Configuration`. If the callback returns `false`, it will redirect to `/error?error=AccessDenied`.
2022-12-22 02:36:54 +00:00
Balázs Orbán
2ba5314e35 docs(core): update jwtand types description 2022-12-21 02:05:55 +01:00
Balázs Orbán
582a3c339a refactor(core): move types moduile to top-level 2022-12-21 01:54:49 +01:00
Balázs Orbán
ea23a93442 refactor(core): move jwt to a single file 2022-12-21 01:39:35 +01:00
ndom91
1d67ad41cc chore(docs): add cleanUrls: true 2022-12-19 20:29:08 +01:00
Yahav
7c50b3da98 chore(docs): fix typo in 02-oauth-tutorial.mdx (#6093) 2022-12-19 20:24:55 +01:00
Balázs Orbán
1b2c373fa1 docs: capitalize 2022-12-19 13:39:23 +00:00
Balázs Orbán
f7275c7527 chore: type updates
fix import

chore: more docs update
2022-12-19 04:03:03 +01:00
Balázs Orbán
e699ff14b8 docs: /reference sidebar improvements (#6115)
* wip

* 🤖 lazy commit

* 🤖 lazy commit

* revert some changes, remove prettier jsdoc plugin for now

* sidebar tweaks

* add adapter module docs

* remove provider docs

* embed all reflections under modules

Based on: https://github.com/TypeStrong/typedoc/issues/2006

Related: https://github.com/tgreyuk/typedoc-plugin-markdown/issues/338

* no trailing slash, update theme

* updates

* update snapshot

* update sidebar and overview
2022-12-19 01:00:06 +00:00
ndom91
6eab7ac25f chore(actions): revert var dump 2022-12-19 01:31:11 +01:00
ndom91
9b05dbc540 chore(actions): add path 2022-12-19 01:28:33 +01:00
ndom91
132a76d951 chore(actions): test github context 2022-12-19 01:26:54 +01:00
ndom91
66cbb522d9 Merge branch 'main' of ssh://github.com/nextauthjs/next-auth 2022-12-19 01:12:47 +01:00
ndom91
553924d902 chore(actions): fix validator path 2022-12-19 01:12:38 +01:00
Balázs Orbán
cba81f0b8c chore: add snippets 2022-12-18 14:12:56 +01:00
Balázs Orbán
b7171ab790 chore: tweak jsdoc formatting/linting 2022-12-18 14:06:00 +01:00
ndom91
43c8f663c6 Revert "fix: pnpm-lock.yaml"
This reverts commit b16b048991.
2022-12-18 04:06:37 +01:00
ndom91
b16b048991 fix: pnpm-lock.yaml 2022-12-18 04:05:16 +01:00
ndom91
62a5d70f9b Merge branch 'main' of ssh://github.com/nextauthjs/next-auth 2022-12-18 04:04:46 +01:00
Balázs Orbán
1b671ae83d docs: format landing page 2022-12-18 02:19:07 +00:00
Andrew Manzanero
cc4b9fc2fc fix(core): check for oidc account types in callback-handler.ts (#6108)
* check oidc account types

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-18 01:46:33 +00:00
Nico Domino
4935166372 chore(docs): add provider-issue and github-discussions redirects (#6110) 2022-12-18 01:44:37 +00:00
Balázs Orbán
695f937dbd chore: change sync action comment 2022-12-18 01:18:08 +00:00
ndom91
ad9eec3676 chore(docs): add provider-issue and github-discussions redirects 2022-12-18 00:07:41 +01:00
Balázs Orbán
2e924edcdf chore: stop sync next-auth-example from main branch 2022-12-17 19:40:20 +00:00
Balázs Orbán
c7627778eb chore: no prettier check yet 2022-12-17 14:33:52 +01:00
Balázs Orbán
8b5644453b docs: set up API reference generation 2022-12-17 14:26:14 +01:00
Balázs Orbán
84291d3e81 chore: fix formatting and linting 2022-12-16 15:57:55 +01:00
Nico Domino
67e5c236f6 chore(docs): wildcard path matching (#6092) 2022-12-16 14:22:51 +01:00
Nico Domino
8972defa4b chore(vercel): add errors and warnings subdomain redirects (#6091) 2022-12-16 14:10:39 +01:00
Aleš Vaupotič
85667dd681 docs(sveltekit): add note about deploying to providers other than vercel (#6075)
* Directions to deploy outside Vercel

An additional ENV variable is needed when deploying with another service.

* Updated as suggested, AUTH_TRUST_HOST is a boolean

Add AUTH_TRUST_HOST for deploy outside Vercel
2022-12-16 05:06:26 +01:00
Lluis Agusti
d9532745eb docs: update names to Auth.js (#6077) 2022-12-16 05:03:31 +01:00
Robert Soriano
1e6daa8304 chore(examples): use @auth/core in Nuxt playground (#6081)
* nuxt: rewrite server handler to use @auth/core

* nuxt: fix main tsconfig

* nuxt: remove unused module

* nuxt: update client and server ports

* nuxt: remove iframe style

* nuxt: update readme
2022-12-16 02:47:44 +00:00
meesvandongen
70a3e3f662 chore(docs): Fix nextjs.md code block (#6037)
chore: fix quotes
2022-12-16 01:00:22 +01:00
Balázs Orbán
875f79d11e chore(release): bump package version(s) [skip ci] 2022-12-15 11:38:20 +01:00
Shivam Meena
6cfe502ae0 fix(sveltekit): correctly reference SvelteKit as peer dependency (#6066)
You added svelte-kit@^1.0.0  instead of @sveltejs/kit": "^1.0.0

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-15 10:28:55 +00:00
Robert Soriano
91c6b05ed8 fix(sveltekit): reuse types from @auth/core/providers (#6064)
* feat: use client provider types from @auth/core/providers

* format

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-15 10:27:32 +00:00
Nico Domino
45a18930c8 chore: try redirect instead of rewrite (#6063) 2022-12-15 00:34:24 +01:00
Arnaud Zheng
6f22a49c7d chore: removing console log (#6061) 2022-12-15 00:24:15 +01:00
Nico Domino
fea30069c9 chore: try redirect instead of rewrite (#6062) 2022-12-15 00:14:42 +01:00
Nico Domino
cd01707530 chore: try redirect instead of rewrite (#6060) 2022-12-14 23:56:49 +01:00
Lluis Agusti
d9a2df3a3d chore(docs): fix broken links (#6053) 2022-12-14 21:49:15 +01:00
Nico Domino
f4a1ed1eb7 chore(docs): add note regarding AUTH_SECRET to SvelteKit docs (#6058) 2022-12-14 21:30:54 +01:00
Nico Domino
a97737cc18 fix: rename social-media-card.png for cache busting (#6057) 2022-12-14 20:43:17 +01:00
Nico Domino
b44d1a005e fix: update docusaurus config url to authjs.dev (#6056) 2022-12-14 20:34:41 +01:00
Nico Domino
2c077e1491 chore(docs): add flex-wrap to docs home button wrapper (#6055) 2022-12-14 20:28:05 +01:00
Nico Domino
19804661d2 chore(docs): fix social media card copy (#6054) 2022-12-14 19:16:16 +01:00
Nico Domino
b7f1e3e7f8 docs: move to Auth.js (#6024)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Thang Vu <hi@thvu.dev>
2022-12-14 18:33:49 +01:00
Balázs Orbán
7757024d79 chore(examples): update example readmes 2022-12-14 17:13:48 +01:00
Balázs Orbán
3f15dc67e1 chore: update readme 2022-12-14 16:59:08 +01:00
Balázs Orbán
5359694b8f chore: change package versions to latest 2022-12-14 16:45:46 +01:00
Balázs Orbán
66686fa5fc chore(example): rename repo 2022-12-14 16:41:14 +01:00
Balázs Orbán
1d6330b719 chore: empty commit 2022-12-14 16:40:38 +01:00
Balázs Orbán
0eb20d1097 chore: sync SvelteKit Auth example 2022-12-14 16:39:21 +01:00
Balázs Orbán
ac30402c6a chore(examples): move examples 2022-12-14 15:58:45 +01:00
Balázs Orbán
caa6c6ae42 chore(release): bump package version(s) [skip ci] 2022-12-14 15:37:29 +01:00
Nico Domino
a6ac48314e chore(actions): issue-validator path to 'repro.md' (#6051) 2022-12-14 15:36:30 +01:00
Balázs Orbán
f8675bc245 fix(sveltekit): add svelte as peer dependency, fix env vars 2022-12-14 15:32:19 +01:00
Balázs Orbán
3d4842dcc9 fix(core): change imports 2022-12-14 15:31:57 +01:00
Balázs Orbán
7d7d1b2f80 chore(release): bump package version(s) [skip ci] 2022-12-14 13:27:31 +01:00
Balázs Orbán
9a4f3db7b0 chore: format 2022-12-14 13:10:13 +01:00
Balázs Orbán
6aad07a95c chore: update lock file 2022-12-14 13:10:13 +01:00
Balázs Orbán
cfed5b976f fix(sveltekit): include module augmentation 2022-12-14 13:10:13 +01:00
Balázs Orbán
d34108091f fix(core): use preact as JSX runtime 2022-12-14 13:10:13 +01:00
Balázs Orbán
7bf79b89a8 chore(sveltekit): clean up playground 2022-12-14 13:10:13 +01:00
Balázs Orbán
4cd688703a fix(core): drop "in production" from missing secret error 2022-12-14 13:10:13 +01:00
Balázs Orbán
57b176840e chore(release): bump package version(s) [skip ci] 2022-12-14 09:49:43 +01:00
Thang Vu
6298d955df fix(frameworks): run check before building for @auth/sveltekit (#6044)
* fix(frameworks): run check before building for @auth/sveltekit

* run format
2022-12-14 15:44:08 +07:00
Balázs Orbán
2ad1cb3f8c chore(release): bump package version(s) [skip ci] 2022-12-14 02:51:15 +01:00
Balázs Orbán
98707282eb fix(release): tweak package metadata 2022-12-14 02:45:57 +01:00
Balázs Orbán
f4a2430891 fix(release): build packages before publish 2022-12-14 02:45:18 +01:00
Balázs Orbán
575bcb5710 chore: format sveltekit playground 2022-12-13 23:45:32 +01:00
Balázs Orbán
e7af366a3b chore(release): bump package version(s) [skip ci] 2022-12-13 22:04:43 +01:00
Balázs Orbán
3bdf7f56f0 fix(core): update README 2022-12-13 21:57:30 +01:00
Balázs Orbán
b00a694a4f fix(frameworks): update @auth/sveltekit README 2022-12-13 21:56:53 +01:00
Balázs Orbán
6ffecfb87d chore(release): bump package version(s) [skip ci] 2022-12-13 21:53:56 +01:00
Balázs Orbán
22c29361e5 feat(frameworks): Introduce SvelteKit Auth 2022-12-13 21:48:15 +01:00
Balázs Orbán
b157554a5f chore: move 2022-12-13 21:33:27 +01:00
Balázs Orbán
08fed7eddd chore: empty commit 2022-12-13 21:21:22 +01:00
Thang Vu
b5e1b19771 feat(frameworks): Introduce SvelteKit Auth (#6041)
* WIP use `Request` and `Response` for core

* bump Next.js

* rename ts types

* refactor

* simplify

* upgrade Next.js

* implement body reader

* use `Request`/`Response` in `next-auth/next`

* make linter happy

* revert

* fix tests

* remove workaround for middleware return type

* return session in protected api route example

* don't export internal handler

* fall back host to localhost

* refactor `getBody`

* refactor `next-auth/next`

* chore: add `@edge-runtime/jest-environment`

* fix tests, using Node 18 as runtime

* fix test

* remove patch

* upgrade/add dependencies

* type and default import on one line

* don't import all adapters by default in dev

* simplify internal endpoint config

Instead of passing url and params around as a string and an object,
we parse them into a `URL` instance.

* assert if both endpoint and issuer config is missing

* allow internal redirect to be `URL`

* mark clientId as always internally, fix comments

* add web-compatible authorization URL handling

* fix type

* fix neo4j build

* remove new-line

* reduce file changes in the PR

* simplify types

* refactor `crypto` usage

In Node.js, inject `globalThis.crypto` instead of import

* add `next-auth/web`

* refactor

* send header instead of body to indicate redirect response

* fix eslint

* fix tests

* chore: upgrade dep

* fix import

* refactor: more renames

* wip core

* support OIDC

* remove `openid-client`

* temprarily remove duplicate logos

* revert

* move redirect logic to core

* feat: add sveltekit auth

* wip fix css

* revert Logo component

* output ESM

* fix logout

* deprecate OAuth 1,  simplify internals, improve defaults

* refactor providers, test facebook

* fix providers

* target es2020

* fix CSS

* fix AuthHandler, add getServerSession

* update lock file

* make logos optional

* sync with `next-auth`

* clean up `next-auth/edge`

* sync

* Sync (#2)

* fix(core): properly construct url (#5984)

* chore(release): bump package version(s) [skip ci]

* fix(core): add protocol if missing

* fix(core): throw error if no action can be determined

* test(core): fix test

* chore(release): bump package version(s) [skip ci]

* chore(docs): add new tutorial (#5604)

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

* fix(core): handle `Request` -> `Response` regressions  (#5991)

* fix(next): don't override `Content-Type` by `unstable_getServerSession`

* fix(core): handle `,` while setting `set-cookie`

* chore(release): bump package version(s) [skip ci]

* fix(sequelize): increase sequelize `id_token` column length (#5929)

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

* fix(core): correct status code when returning redirects (#6004)

* fix(core): correctly set status when returning redirect

* update tests

* forward other headers

* update test

* remove default 200 status

* fix(core): host detection/NEXTAUTH_URL (#6007)

* rename `host` to `origin` internally

* rename `userOptions` to `authOptions` internally

* use object for `headers` internally

* default `method` to GET

* simplify `unstable_getServerSession`

* allow optional headers

* revert middleware

* wip getURL

* revert host detection

* use old `detectHost`

* fix/add some tests wip

* move more to core, refactor getURL

* better type auth actions

* fix custom path support (w/ api/auth)

* add `getURL` tests

* fix email tests

* fix assert tests

* custom base without api/auth, with trailing slash

* remove parseUrl from assert.ts

* return 400 when wrong url

* fix tests

* refactor

* fix protocol in dev

* fix tests

* fix custom url handling

* add todo comments

* chore(release): bump package version(s) [skip ci]

* update lock file

* fix(next): correctly bundle next-auth/middleware
fixes #6025

* fix(core): preserve incoming set cookies (#6029)

* fix(core): preserve `set-cookie` by the user

* add test

* improve req/res mocking

* refactor

* fix comment typo

* chore(release): bump package version(s) [skip ci]

* make logos optional

* sync with `next-auth`

* clean up `next-auth/edge`

* sync

Co-authored-by: Balázs Orbán <balazsorban44@users.noreply.github.com>
Co-authored-by: Thomas Desmond <24610108+thomas-desmond@users.noreply.github.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Cyril Perraud <perraud.cyril@gmail.com>

* merge

* clean up sveltekit auth handler

* upgrade playground to latest

* upgrade sveltekit auth to latest

* Some more refactoring

* feat: extract type to core and reuse in sveltekit

* remove uuid

* make secret required in dev

* remove todo comments

* pass through OAuth client options

* generate declaration map

* default env secret to AUTH_SECRET

* temporary Headers fix

* move pages to lib

* move errors to lib

* move pages/index to lib

* move routes to lib

* move init to lib

* move styles to lib

* move types to lib

* move utils to lib

* fix imports

* update ignore/clean patterns

* fix imports

* update styles ts

* update gitignore

* update exports field

* revert `next-auth`

* remove extra tsconfig files

* remove `private` from package.json

* revert

* feat sveltekit

* commit

* remove unused file, expose type

* remove nextauth_url, memoize locals.getSession

* move to dependency

* fix

* format

* fix post build

* simplify

* fix lock file

* add packages/frameworks

* update package.json

* update gitignore

* Delete .gitignore

* Update types.ts

* Update tsconfig.dev.json

* skip test

* format

* skip format/lint

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Balázs Orbán <balazsorban44@users.noreply.github.com>
Co-authored-by: Thomas Desmond <24610108+thomas-desmond@users.noreply.github.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Cyril Perraud <perraud.cyril@gmail.com>
2022-12-13 20:10:53 +00:00
Balázs Orbán
6680860293 chore(release): bump versions [skip release] 2022-12-13 19:35:05 +01:00
Balázs Orbán
c7d93c61e0 chore: remove 2022-12-13 19:28:54 +01:00
Balázs Orbán
a7b6a29773 feat(web): expose Web API compatible version of next-auth (#5536)
* WIP use `Request` and `Response` for core

* bump Next.js

* rename ts types

* refactor

* simplify

* upgrade Next.js

* implement body reader

* use `Request`/`Response` in `next-auth/next`

* make linter happy

* revert

* fix tests

* remove workaround for middleware return type

* return session in protected api route example

* don't export internal handler

* fall back host to localhost

* refactor `getBody`

* refactor `next-auth/next`

* chore: add `@edge-runtime/jest-environment`

* fix tests, using Node 18 as runtime

* fix test

* remove patch

* upgrade/add dependencies

* type and default import on one line

* don't import all adapters by default in dev

* simplify internal endpoint config

Instead of passing url and params around as a string and an object,
we parse them into a `URL` instance.

* assert if both endpoint and issuer config is missing

* allow internal redirect to be `URL`

* mark clientId as always internally, fix comments

* add web-compatible authorization URL handling

* fix type

* fix neo4j build

* remove new-line

* reduce file changes in the PR

* simplify types

* refactor `crypto` usage

In Node.js, inject `globalThis.crypto` instead of import

* add `next-auth/web`

* refactor

* send header instead of body to indicate redirect response

* fix eslint

* fix tests

* chore: upgrade dep

* fix import

* refactor: more renames

* wip core

* support OIDC

* remove `openid-client`

* temprarily remove duplicate logos

* revert

* move redirect logic to core

* wip fix css

* revert Logo component

* output ESM

* fix logout

* deprecate OAuth 1,  simplify internals, improve defaults

* refactor providers, test facebook

* fix providers

* target es2020

* fix CSS

* update lock file

* make logos optional

* sync with `next-auth`

* clean up `next-auth/edge`

* sync

* remove uuid

* make secret required in dev

* remove todo comments

* pass through OAuth client options

* generate declaration map

* default env secret to AUTH_SECRET

* temporary Headers fix

* move pages to lib

* move errors to lib

* move pages/index to lib

* move routes to lib

* move init to lib

* move styles to lib

* move types to lib

* move utils to lib

* fix imports

* update ignore/clean patterns

* fix imports

* update styles ts

* update gitignore

* update exports field

* revert `next-auth`

* remove extra tsconfig files

* remove `private` from package.json

* remove unused file, expose type

* move gitignore, reduce exposed types

* add back tsconfig files

* remove leftover

* revert gitignore

* remove test script
2022-12-13 18:24:30 +00:00
Balázs Orbán
092ab9c128 chore: update release script 2022-12-13 18:01:45 +01:00
Balázs Orbán
36f44a869a chore: move files to nextuahtjs/.github 2022-12-13 17:40:17 +01:00
Balázs Orbán
2913fbac3b chore(release): bump package version(s) [skip ci] 2022-12-12 14:53:01 +01:00
Balázs Orbán
2875b49f11 fix(core): preserve incoming set cookies (#6029)
* fix(core): preserve `set-cookie` by the user

* add test

* improve req/res mocking

* refactor

* fix comment typo
2022-12-12 13:47:34 +00:00
Balázs Orbán
5259d247a2 fix(next): correctly bundle next-auth/middleware
fixes #6025
2022-12-12 11:59:37 +01:00
Balázs Orbán
d1d93fd75e chore(release): bump package version(s) [skip ci] 2022-12-11 15:52:57 +01:00
Balázs Orbán
62f672ae30 fix(core): host detection/NEXTAUTH_URL (#6007)
* rename `host` to `origin` internally

* rename `userOptions` to `authOptions` internally

* use object for `headers` internally

* default `method` to GET

* simplify `unstable_getServerSession`

* allow optional headers

* revert middleware

* wip getURL

* revert host detection

* use old `detectHost`

* fix/add some tests wip

* move more to core, refactor getURL

* better type auth actions

* fix custom path support (w/ api/auth)

* add `getURL` tests

* fix email tests

* fix assert tests

* custom base without api/auth, with trailing slash

* remove parseUrl from assert.ts

* return 400 when wrong url

* fix tests

* refactor

* fix protocol in dev

* fix tests

* fix custom url handling

* add todo comments
2022-12-11 14:48:28 +00:00
Balázs Orbán
2c669b32fc fix(core): correct status code when returning redirects (#6004)
* fix(core): correctly set status when returning redirect

* update tests

* forward other headers

* update test

* remove default 200 status
2022-12-11 12:55:16 +00:00
Cyril Perraud
2dea8919e5 fix(sequelize): increase sequelize id_token column length (#5929)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-12-10 12:34:45 +01:00
Balázs Orbán
6fdb0da6eb chore(release): bump package version(s) [skip ci] 2022-12-09 00:34:31 +01:00
Balázs Orbán
5c4a9a697d fix(core): handle Request -> Response regressions (#5991)
* fix(next): don't override `Content-Type` by `unstable_getServerSession`

* fix(core): handle `,` while setting `set-cookie`
2022-12-08 23:29:25 +00:00
Thomas Desmond
eddd8fd7f9 chore(docs): add new tutorial (#5604)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-12-08 18:24:58 +01:00
Balázs Orbán
b74bfc68e8 chore(release): bump package version(s) [skip ci] 2022-12-08 05:16:10 +01:00
Balázs Orbán
0a140cdf87 test(core): fix test 2022-12-08 05:11:37 +01:00
Balázs Orbán
157269e0fb fix(core): throw error if no action can be determined 2022-12-08 05:10:26 +01:00
Balázs Orbán
221bc8e99c fix(core): add protocol if missing 2022-12-08 04:54:42 +01:00
Balázs Orbán
f856363ac8 chore(release): bump package version(s) [skip ci] 2022-12-08 04:38:03 +01:00
Balázs Orbán
f3291025e6 fix(core): properly construct url (#5984) 2022-12-08 04:33:20 +01:00
Balázs Orbán
bc0912cc71 chore(release): bump package version(s) [skip ci] 2022-12-08 00:08:09 +01:00
Branden Cash
b19b2bcb3f fix(core): don't mutate authOptions in unstable_getServerSession (#5973) 2022-12-07 22:04:53 +01:00
Balázs Orbán
63c2a15717 Update nextjs.md 2022-12-07 14:39:57 +01:00
Balázs Orbán
9209b48dbe chore: add issue validator 2022-12-06 12:21:42 +01:00
Balázs Orbán
0fcc6a0d04 refactor: more renames 2022-12-05 13:38:29 +01:00
Balázs Orbán
cbf8c7a59f refactor: rename 2022-12-03 15:51:38 +01:00
Balázs Orbán
0e6c51adec refactor: rename 2022-12-03 15:41:39 +01:00
Balázs Orbán
c4352a7d56 chore(dev): upgrade dev app and deps
Conflicts:
	apps/dev/pages/api/auth/[...nextauth].ts
2022-12-03 15:33:49 +01:00
Balázs Orbán
7e91d7df54 refactor(core): use standard Request and Response (#4769)
* WIP use `Request` and `Response` for core

* bump Next.js

* rename ts types

* refactor

* simplify

* upgrade Next.js

* implement body reader

* use `Request`/`Response` in `next-auth/next`

* make linter happy

* revert

* fix tests

* remove workaround for middleware return type

* return session in protected api route example

* don't export internal handler

* fall back host to localhost

* refactor `getBody`

* refactor `next-auth/next`

* chore: add `@edge-runtime/jest-environment`

* fix tests, using Node 18 as runtime

* fix test

* remove patch

* fix neo4j build

* remove new-line

* reduce file changes in the PR

* fix tests

* fix tests

* refactor

* refactor

* add host tests

* refactor tests

* fix body reading

* fix tests

* use 302

* fix test

* fix again

* fix tests

* handle when body is `Buffer`

* move comment
2022-12-03 13:39:08 +00:00
Balázs Orbán
c1424136db chore(dev): don't load all adapters in dev app 2022-12-03 13:45:06 +01:00
Balázs Orbán
f2a07932b9 chore(release): bump package version(s) [skip ci] 2022-12-03 12:38:32 +01:00
Balázs Orbán
25c7ce1d2b chore: revert sync-example action 2022-12-03 12:31:22 +01:00
Vedant
227a233bd8 chore(adapters): update firebase sdk version in firebase adapter (#5902)
* Update firebase SDK version

* Update pnpm-lock.yaml

* add `--debug`

* move flag

* add `FIREBASE_TOKEN`

* chore: upgrade `firebase-tools`

* revert peer dep change

* remove --debug flag

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-12-03 11:29:09 +00:00
Vedant
cf9f133aa3 fix(adapters): tsconfig for firebase and pouchdb (#5945)
* Update tsconfig.json

* Update tsconfig.json
2022-12-03 09:48:55 +01:00
Arnaud Zheng
2301c1be44 chore(types): fix typo in comment (#5815)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-12-02 16:39:28 +01:00
jintak0401
6e408e24bf fix(provider): modify response.name to response.nickname (Naver) (#5915)
fix(provider): modify response.name to response.nickname (Naver Provider)

Co-authored-by: Thang Vu <hi@thvu.dev>
2022-12-01 08:12:16 +07:00
Jason Brady
f277989c69 feat(core): make pkce and state maxAge configurable on the cookies (#4719)
* feat(cookies): make pkce and state maxAge configurable on the cookies (#4660)

* added tests for pkce and state handlers
2022-12-01 08:02:42 +07:00
Nico Domino
6146e93288 chore(docs): add new provider styling notes to CONTRIBUTING.md (#5900) 2022-11-30 15:44:50 +01:00
Nico Domino
1ff565da6c chore(docs): update oauth.md styling docs (#5899)
* chore(docs): update oauth.md styling docs

* chore: add note about styling object

* chore: typo

* chore: filename typos
2022-11-30 15:43:55 +01:00
Nico Domino
41f75cf870 chore(actions): version bump all deps (#5903) 2022-11-28 11:10:15 +00:00
Justin W Hall
dd591ed8d0 chore(docs): fix path Strava provider file (#5853)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-11-27 14:04:17 +01:00
koolskateguy89
297bc2317f chore(docs): fix spelling in docs (#5867)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-11-27 13:44:35 +01:00
Tormod Flesjø
b170138e70 chore: update mongodb.md with typescript filetypes (#5889) 2022-11-27 13:11:54 +01:00
Balázs Orbán
a307079e0f fix(ts): improve unstable_getServerSession return type (#5792)
Co-authored-by: Thang Vu <hi@thvu.dev>
2022-11-24 15:13:05 +01:00
Jacob Penny
d52b7a6b7d chore(adapters): fix typo on Firebase Adapter (#5813) 2022-11-24 14:31:43 +01:00
Jake Mulley
30b69a07eb chore: fix import statement for next-auth/providers/email (#5860) 2022-11-21 12:07:09 +01:00
Balázs Orbán
0d1757814f fix(next): improve dev environment variable handling (#5763)
* fix(next): HIDE `NEXTAUTH_URL` warning locally

* refactor: move out `process.env` from core

* fix tests

* simplify

* swap
2022-11-20 09:08:10 +00:00
Thang Vu
068f9b50b8 chore(release): bump package version(s) [skip ci] 2022-11-19 21:29:28 +07:00
Martin Sonnberger
dac490b7a1 feat(adapters): Add Supabase adapter (#5050)
* Add Supabase adapter

* Add Supabase adapter

* Add schema setup to docs

* supabase config changes

* chore: update to supabase-js v2.

* chore: migrate to next_auth schema.

* feat: add supabase examples.

* chore: update docs.

* chore: add telemetry.

* fix: resolve issues after merge.

* chore: extend session type.

* typo

* chore: remove unnecessary grants.

* fix: schema constraints.

Co-authored-by: thorwebdev <thor@supabase.io>
Co-authored-by: Thor 雷神 Schaeff <5748289+thorwebdev@users.noreply.github.com>
Co-authored-by: Thang Vu <hi@thvu.dev>
2022-11-19 20:56:20 +07:00
Gregor Adams
c0f51669e2 docs: upadte mongodb guide (#5809)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-11-16 16:38:55 +01:00
Nico Domino
cbf8ce3510 chore: fix signin btns svg URLs to 'main' (#5826) 2022-11-15 22:07:30 +01:00
Nico Domino
1c19cc71df chore: add tour de source link to CONTRIBUTING.md (#5820) 2022-11-15 16:47:15 +00:00
Nico Domino
9d962a0056 feat: add signin button styles (#5802)
* feat: add signin button styles

* fix: remove unnecessary spans

chore: rm comments

* Update packages/next-auth/src/core/pages/signin.tsx

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

* feat: add provider svgs to repo

* fix: adjust SVG sizes

* fix: adjust provider btn to logo links

* feat: apple provider btn style

* fix: add apple-dark svg

* feat: atlassian logo and style

* feat: auth0 logo and style

* feat: azure logo and style

* fix: azure logo size

* feat: battlenet logo and style

* feat: box logo and style

* feat: cognito logo and style

* feat: discord logo and style

* feat: facebook logo and style

* feat: foursquare logo and style

* fix: foursquare logo size

* feat: freshbooks logo and style

* feat: gitlab logo and style

* fix: gitlab logo whitespace

* feat: hubspot logo and style

* feat: instagram logo and style

* feat: keycloak logo and style

* feat: keycloak logo resize

* feat: linkedin logo and style

* feat: mailchimp logo and style

* feat: okta logo and style

* feat: update okta logos

* feat: patreon logo and style

* fix: okta logo viewbox

* feat: slack logo and style

* feat: spotify logo and style

* feat: todoist logo and style

* fix: spotify logo size

* feat: trakt logo and style

* feat: twitch logo and style

* feat: twitter logo and style

* feat: vk logo and style

* feat: wikimedia logo and style

* feat: workos logo and style

* fix: wikimedia-dark logo + twitter (legacy)

* fix: button:active styling

* fix: ignore eslint inline css custom properties warning

* fix: improve darkmode default btn stylign

* fix: swap github btn colors

* fix: swap line btn theme colors

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-11-15 16:46:42 +00:00
Håkon Collett Bjørgan
8387c78e3f fix(core): update JSDoc for jwt in NextAuthOptions (#5804) 2022-11-13 07:55:35 +01:00
Balázs Orbán
58e30a6af6 chore(release): bump package version(s) [skip ci] 2022-11-07 21:33:48 +01:00
Balázs Orbán
b7ff987baf docs: update unstable_getServerSession in RSC 2022-11-07 21:20:06 +01:00
Balázs Orbán
782812a52b fix(next): correctly parse headers with RSC (#5753)
* fix(next): correctly parse headers with RSC

* chore(dev): simplify/fix dev app

* make authOptions optional for RSC case
2022-11-07 20:19:14 +00:00
Balázs Orbán
32f2a0cea3 chore(release): bump package version(s) [skip ci] 2022-11-07 03:40:46 +01:00
Balázs Orbán
3343ef18b2 fix(next): conditional RSC support (#5745)
* fix(next): conditional RSC

* use Node 16 for version determination

* convert cookies

* use map instead of reduce
2022-11-07 02:33:47 +00:00
Robert Soriano
6280fe9e10 docs: add Nuxt 3 playground (#5746) 2022-11-06 20:33:02 +01:00
Balázs Orbán
52a2bf3e28 chore(release): bump package version(s) [skip ci] 2022-11-06 06:24:30 +01:00
Balázs Orbán
180c6252d9 fix(next): build RSC+unstable_getServerSession 2022-11-06 06:09:27 +01:00
Balázs Orbán
362e981e6d chore(release): bump package version(s) [skip ci] 2022-11-06 06:07:47 +01:00
Balázs Orbán
5198eb19f7 fix(next): build RSC+unstable_getServerSession 2022-11-06 05:53:38 +01:00
Balázs Orbán
0210cfccf3 chore(release): bump package version(s) [skip ci] 2022-11-06 05:12:31 +01:00
Balázs Orbán
e90925bea0 feat(next): allow unstable_getServerSession in Server Components (#5741)
* feat(next): support Server Components with `unstable_getServerSession`

* chore: remove `.entries`

* docs(next): add documentation for RSC

* update beta docs

* chore(dev): add app dir

* fix text

* only show second warning if using with RSC

* only delete expires for RSC case
2022-11-06 04:03:26 +00:00
Leif Arriens
27a0b70d87 docs: fix import path at providers/oauth (#5725) (#5736) 2022-11-06 00:54:01 +01:00
Balázs Orbán
c676e93d8a chore(release): bump package version(s) [skip ci] 2022-11-05 23:43:00 +01:00
Matthew Francis Brunetti
f498e9cd0a fix(react): allow imports from "next-auth/react" in RSC (#5718) 2022-11-05 23:09:51 +01:00
Balázs Orbán
2f3396d376 chore(release): bump package version(s) [skip ci] 2022-11-04 03:48:42 +01:00
Balázs Orbán
e62f879ebd chore(adapters): run Xata tests 2022-11-04 03:38:24 +01:00
Balázs Orbán
f67959eb04 chore: update example to Next.js 13 2022-11-04 03:33:42 +01:00
Henrik Wenz
060953dacf fix: support Next.js 13 (#5710)
* Migrate dev app to Next.js Version 13

* Update core types

* Fix middleware

https://github.com/nextauthjs/next-auth/issues/5649

* Use new ResponseCookie API

https://github.com/vercel/next.js/pull/41526
2022-11-04 03:32:48 +01:00
Nico Miebach
30ad639d16 fix: Add support for Node 18 (#5656)
* add support for Node 18

* update node engines in packages/next-auth

Co-authored-by: Thang Vu <hi@thvu.dev>
2022-10-30 23:54:16 -07:00
Thang Vu
777da4302d fix: add next 13 as peer dependencies (#5657)
fix: add next 13 as peer dependencies
2022-10-30 23:46:24 -07:00
Tejas Kumar
733fd5f234 feat(adapters): add Xata adapter (#4911)
* Add Xata adapter

* Adjust slogan

* Namespace tables for better DX

* Fix types

* Adjust docs

* Import type only

* Add scripts

* Fix types

* Update packages/adapter-xata/package.json

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

* Update packages/adapter-xata/package.json

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

* Update packages/adapter-xata/src/index.ts

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

* Update packages/adapter-xata/src/index.ts

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

* Update packages/adapter-xata/src/index.ts

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

* Update docs/docs/adapters/xata.md

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

* Update docs/docs/adapters/xata.md

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

* Address more comments

* Clarify codegen

* Fix by adding src

* Fix types

* More cleanup

* Fix import

* Clean up model

* Adjust docs

* Update docs

* Housekeeping

* Add tests

* Update lockfile

* Update packages/adapter-xata/tsconfig.json

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

* Update packages/adapter-xata/src/index.ts

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Thang Vu <hi@thvu.dev>
2022-10-27 21:39:49 +07:00
Thang Vu
a787efc6be docs: improve documentation for adding new provider (#5633) 2022-10-25 10:05:52 +07:00
Bruno Crosier
261968b9bb docs: improve credentials docs (#5627) 2022-10-24 23:33:46 +07:00
Thang Vu
4dbbe5b2d9 chore(release): bump package version(s) [skip ci] 2022-10-23 22:17:19 +07:00
Balázs Orbán
d9df582fa8 feat(client): add refetchWhenOffline option (#4940)
* feat(client): add `refetchWhenOffline` option

* docs(client): document `refetchWhenOffline` option

* add TODO comment for next major

* feat: improve refetch hook logic

* fix: add todo back

* chore: small refactoring

Co-authored-by: Thang Vu <hi@thvu.dev>
2022-10-23 22:09:30 +07:00
Matsuoka
af840b2106 feat(providers): Add Todoist provider (#5253)
* feat: Add Todoist provider

* fix: use openid-client

* chore: add Todoist provider to issue template

Co-authored-by: Thang Vu <hi@thvu.dev>
2022-10-23 17:16:06 +07:00
jcdogo
ba89907d5a feat: Add allowDangerousEmailAccountLinking option for OAuth providers (#5513)
* Add opt-in for dangerous linking

* Add documentation for allowDangerousEmailAccountLinking option.

* Add link to FAQ.

* Fix nullish coalescing operator linting error.
2022-10-23 17:08:25 +07:00
Steven Tey
08eaeba79f docs: Fixed typo (#5609) 2022-10-21 10:07:13 +01:00
Usman Sabuwala (Max Programming)
c31eabfcc6 docs: Update the nodemailer well known page URL (#5573) 2022-10-19 22:28:40 +02:00
Balázs Orbán
4423673424 docs: update patreon.md 2022-10-18 21:32:51 +01:00
X
281d0948b9 docs: Typo error on Example (#5590)
Removed unwanted ")" from Example
2022-10-18 21:32:33 +01:00
Lluis Agusti
5246183c55 chore: docs updates (#5581)
* chore: fix version label

* upgrade docusaurus

* fix

* fix

* fix links, NextAuth -> NextAuth.js

* NextJS -> Next.js

* fix guides

* add docusaurus type

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-15 16:39:33 +01:00
Lluis Agusti
cb56cd44ca refactor(docs): re-structure (#4498)
* docs: beta initial commit

* docs(oauth): finish initial tutorial

* docs(oauth-tutorial): finish guide

* docs(docusaurus): just log broken links

* docs: re-organising beta

* docs(beta): sort documents for sorting

* docs: more re-structure

* docs: more re-structure (2)

* fix: more WIP

* fix: more WIP

* chore: more updates

* chore: wip

* chore: wip

* fix lock file

* docs(getting-started): credentials

* chore: remove json-server file

* chore: cleanup

* remove mongodb from dev app

* chore: cleanup

* revert

* chore: cleanup

* chore: more cleanup changes

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-15 15:45:33 +01:00
Mischa Spiegelmock
6758e1c6d1 refactor(core): allow trusting the forwarded host header (#5561)
* Non vercel-specific way to forward host header

* Update packages/next-auth/src/utils/detect-host.ts

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-15 14:17:20 +02:00
Thang Vu
462cca1087 chore(release): bump package version(s) [skip ci] 2022-10-14 08:52:04 +07:00
Thang Vu
ab48fcfe5b chore: remove codeql run on main push 2022-10-14 08:37:59 +07:00
Thang Vu
fe7aaeded8 fix(ts): TS Module Augmentation (#5556)
* fix: TS Module Augmentation

* match type to AdapterUser

* refactor authorize callback

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-13 09:39:12 +07:00
Anthony Shew
c53c09ea5c docs: options.md grammar fixes (#5562)
Update options.md

Just some grammar!
2022-10-12 20:07:53 +01:00
Matteo Giardino
4bcba45294 docs(client): typo (#5545) 2022-10-11 01:44:15 +01:00
David Walsh
eb5a9bad9d chore(dev): update SvelteKit playground to 1.0.0-next.511 (#5531)
* Update playground-sveltekit to sveltekit rc 511

* Remove prettier config and format

* Fix adapter comment
2022-10-10 18:20:51 +02:00
Balázs Orbán
9a6d95c17c chore: fix TS lint 2022-10-10 02:11:46 +02:00
Balázs Orbán
5b2fc7b570 chore: fix neo4j build 2022-10-10 02:04:09 +02:00
Balázs Orbán
6f459225fa Merge branch 'main' of github.com:nextauthjs/next-auth 2022-10-10 00:30:25 +02:00
Balázs Orbán
f38ee19a8a chore(dev): improve DX 2022-10-10 00:30:22 +02:00
Ranjan Purbey
38a03ed7d8 feat(providers): Add Pinterest Provider (#5485)
* feat(providers): Add Pinterest Provider

* Apply suggestions from code review

* Update pinterest.ts

* Update pinterest.ts

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-09 23:18:45 +01:00
Chris Abernethy
e1eb684cc6 fix(providers): change EVE Online to OAuth2 (#5459) 2022-10-10 00:16:17 +02:00
Thang Vu
777b7b2f23 chore(release): bump package version(s) [skip ci] 2022-10-09 22:52:53 +07:00
Balázs Orbán
6132c3fa75 fix(ts): match TS types better with implementation (#4953)
* refactor(ts): export `AdapterAccount` from `next-auth/adapters`

* chore: run linter, remove prisma warning

* fix(ts): match TS with implementation closer

* remove unused import

* rename error

* add missing dev dependency

* fix type

* fix type

* fix more types and tests

* remove unused `id`

* skip upstash tests in CI

* revert some changes

* fix type

* revert some change

* revert some change

* revert some change

* revert some changes

* update lock file

* revert line change

* revert some change

* improve adapter & oauth typing

* fix test, revert

* apply review suggestion

* Add test for new rejection logics

* Update assert.test.ts

* fix: Hubspot config

* restore some ts-expect-error

* fix: tests in mirko-orm

* fix: remove redundant id: string

* fix: use ts-expect-errors

* fix: simplify provider type

* fix: normalize user options

* restore ts-expect-errors

Co-authored-by: Thang Vu <hi@thvu.dev>
2022-10-09 21:54:01 +07:00
Usman Sabuwala (Max Programming)
94beef77e6 docs: Remove extra space in code (#5515) 2022-10-09 13:40:38 +02:00
Philipp
490d59dd17 fix(middleware): improve handling of custom Next.js basePath (#5109)
* fix(middleware): improve handling of custom nextjs basePath

* fix(middleware): improve extraction of nextjs base path from req.nextUrl

* adapt to req.nextUrl.basePath

* Fix indent

* Add middleware test for custom-base and simplified code a little bit

* Fix indent

* Add another test

* Rename basePath and nextJsBasePath

* Fix lint error
2022-10-09 11:31:28 +07:00
Thang Vu
26a8c5fc6d chore: lint in apps (#5507) 2022-10-06 22:14:12 +01:00
Colby Fayock
e26ec74720 docs(tutorial): Creating a Custom Adapter (#5506)
* Add new item to tutorials page

* Update tutorials.md

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-06 22:12:20 +01:00
Max Peintner
d13997e140 feat(providers): ZITADEL provider (#5479)
* feat: zitadel provider

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

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

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

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-06 09:44:21 +02:00
Balázs Orbán
d6efda077d chore(release): bump package version(s) [skip ci] 2022-10-05 19:30:28 +02:00
Eric Carboni
0a4b99de3b chore(docs): update middleware documentation link (#5492)
closes #5489
2022-10-04 19:25:56 +02:00
Daniel
2d2dfecc9d docs(core): update documentation callbacks to include user id as example (#5465)
* Add user id to `session` and `jwt` callback

* Minor changes

- Notes on why the id is not exposed by default is already documented in the `session` section.

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-03 16:03:33 +02:00
Thang Vu
2a2c3d7a45 chore: add security guidelines to PR & issue template (#5470)
* chore: add security guidelines to pr & issue template

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-03 15:59:19 +02:00
kesoji
82786ac440 chore: remove duplicate key in pacakges/tsconfig/package.json (#5469)
fix: remove duplicate key
2022-10-02 20:51:17 +02:00
Vedant Nandwana
dfe3e02132 docs(adapters): Add TS type to prisma client (#5463)
* docs(adapters): Add prisma client docs for typescript users

Add documentation for connecting prisma client w/ prisma adapter for typescript users.

* docs(adapters): remove prismadb.js for prismadb.ts

remove prismadb.js as it is identical to the prismadb.ts

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-10-01 22:17:41 +02:00
Itunu Lamina
92b38ed740 docs: fix 'JWKKeySupport' typo (#5452)
update 'JWKKeySupport' typo error
2022-09-29 15:34:23 +02:00
Tom Freudenberg
97feae7916 fix(types): export SessionContext #5437 (#5438)
Co-authored-by: Lluis Agusti <hi@llu.lu>

Fixes #5437
2022-09-28 18:48:42 +02:00
Balázs Orbán
24945895e9 chore(release): bump package version(s) [skip ci] 2022-09-28 18:10:38 +02:00
Balázs Orbán
6deccf610f fix(core): return JSON for non-HTML server route errors (#5442)
* fix(core): return JSON for non-HTML server route errors

* refactor: throw in `unstable_getServerSession`

* test: expect `unstable_getServerSession` to throw

* refactor: destructure

* fix unrelated test formatting

* catch error page
2022-09-28 17:01:39 +01:00
Etienne Martin
f770b90219 fix(react): safe use of localStorage API (#5444)
fix: safe use of localstorage

Co-authored-by: Etienne <>
2022-09-28 16:54:07 +01:00
Balázs Orbán
87f4786917 chore: bump release package 2022-09-28 13:51:41 +02:00
Balázs Orbán
191ef06471 chore(release): bump package version(s) [skip ci] 2022-09-28 13:00:32 +02:00
Philip
75e6d8f0aa docs(adapters): Update prisma.md (#5366)
* Update prisma.md

The referenced official doc page describes how to fix the `warn(prisma-client) There are already 10 instances of Prisma Client actively running.` error in development mode.

* Update prisma.md

Implemented best practice for Prisma Client creation.

* Fixed typo in Prisma db filename.
2022-09-28 11:15:55 +01:00
Yixuan Xu
17999edd30 chore(example): fix hydrate problem in react18 (#5439) 2022-09-28 10:50:40 +02:00
Tom Freudenberg
54b1845e58 fix(core): don't lock next in peerDependencies #5427 (#5430)
* Update peerDependencies #5427

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-27 00:04:50 +01:00
Tomas Pozo
879faf9fab docs(middleware): add tip on additional matcher patterns (#5404)
* docs(middleware): add tip on additional matcher patterns

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-26 13:39:32 +02:00
Balázs Orbán
3e3c36891e docs(example): use generic type in AppProps
closes #5401
2022-09-25 10:57:44 +01:00
Balázs Orbán
ac5d8a9795 chore(release): bump package version(s) [skip ci] 2022-09-25 11:42:17 +02:00
Matt Oliver
965c6267e2 feat(core): make session token with DB session strategy customizable (#5328)
* Add option for custom generateSessionToken

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-25 10:26:59 +01:00
Sébastien Vanvelthem
bfc429d20b fix: update jose to fix nextjs edge error with middleware (#5372)
fix: update jose to fix nextjs edge error
2022-09-25 15:46:02 +07:00
Balázs Orbán
2d8e910a19 chore(release): bump package version(s) [skip ci] 2022-09-25 10:29:56 +02:00
voinik
d16e04848e fix(adapters): check token during email verification in Upstash Adapter (#5377)
* Check token during email verification

* Undo accidental linter fix

* Update index.ts

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-25 09:10:55 +01:00
Balázs Orbán
ff3a52895b chore(release): bump package version(s) [skip ci] 2022-09-25 09:42:51 +02:00
Balázs Orbán
e6e03e8842 feat(adapters): update Mikro ORM adapter schema
BREAKING CHANGE:

See https://github.com/nextauthjs/next-auth/pull/5316
2022-09-25 09:29:17 +02:00
Thomas Large
715aad9474 chore: Add Next to peerDeps & bump to 12.2.5 in devDeps (#5384) 2022-09-24 13:39:07 +07:00
Jonas Strassel
902bf92a85 fix(mikro-orm): re-enable tests (#5316) 2022-09-21 23:36:23 +07:00
Eng Zer Jun
44f2a47e6e fix(middleware): use includes() for NextAuth pages (#5104)
* fix(middleware): use `includes()` for NextAuth pages

Some users could be setting their `signIn` and `error` pages option to
`/` to disable the automatically generated pages, as suggested in [1].

This commit reverts the behaviour for matching `signIn` and `error`
pages in `handleMiddleware` to pre-v4.10.3.

```
const signInPage = "/"
const errorPage = "/"
const publicPaths = [signInPage, errorPage, "/_next", "/favicon.ico"]

// pathname = "/" will return true
publicPaths.some((p) => pathname.startsWith(p))
```

Fixes: aedabc8d ("fix: avoid redirect on always public paths")
Reference [1]: https://github.com/nextauthjs/next-auth/discussions/2330#discussioncomment-1678298
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test(middleware): add tests for public paths

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Thang Vu <thvu@hey.com>
2022-09-18 11:07:46 +07:00
dependabot[bot]
a3b92dbaec chore(deps): bump jose from 4.5.0 to 4.9.3 in /apps/playground-sveltekit (#5359)
Bumps [jose](https://github.com/panva/jose) from 4.5.0 to 4.9.3.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/panva/jose/compare/v4.5.0...v4.9.3)

---
updated-dependencies:
- dependency-name: jose
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-17 01:55:54 +02:00
Steve Burtenshaw
bdd3ab2816 docs(middleware): remove reference to nested (#5355)
Fixes #5180
2022-09-16 10:30:58 +02:00
Dulmandakh
ba55f06585 chore(deps): bump cookie to 0.5.0 (#5339) 2022-09-14 18:31:00 +02:00
Steve Burtenshaw
d2b877fb28 docs(client): onUnauthenticated reference (#5340) 2022-09-14 17:26:02 +02:00
Yuriy Gromchenko
658b22d9fb docs(atlassian): update provider scope (#5337) 2022-09-14 17:23:01 +02:00
Mircea Trofimciuc
a0beb02f77 feat(providers): Add HubSpot Provider (#4633)
* Typos fix

* Added HubSpot Provider

* updates to profile

* Update docs/docs/providers/hubspot.md

Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>

* fixed typo and outsourced required fields

* removing redirectURL from the provider config

* replaced with "client_secret_post" client method

Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
2022-09-11 10:43:28 +07:00
Thang Vu
5727c5f4e6 chore: tweak tsconfig files 2022-09-10 09:39:26 +07:00
Balázs Orbán
8104cb1287 chore: fix builds/tests/eslint (#4780)
* chore(deps): upgrade `typescript`

* chore(ts): don't exclude test files in tsconfig

* test: expect error when overriding `NODE_ENV`

* chore: remove unused import

* format

* chore: use pnpm@7 in action

* chore: fix eslint

* chore: remove pnpm from engines

* chore: fix configs/builds

* fix: make eslint works

* Update pnpm-lock.yaml

* fix: build failure

* fix: add react to paths

* ignore upstash for now

* add eslintignore, add a bunch of tsconfig.eslint.json

* ignore mikro orm for now

* Delete tsconfig.eslint.json

* Update package.json

* Update pnpm-lock.yaml

* move eslint back to package.json

* move eslintrc.js out

Co-authored-by: Thang Vu <thvu@hey.com>
Co-authored-by: Thang Vu <thang.vu@binance.com>
2022-09-09 13:51:40 +02:00
Balázs Orbán
44aaa6f1c3 chore: turbo cleanup (#4951)
* clean up `package.json` files

* chore(ts): make sure `next-auth/next` does not conflict with `next`

* simplify `turbo.json`

* fix: apply suggestion

* simplify doc dev command

* ignore upstash redis again

* ignore mikro orm for now

* chore: dev command

* update lock file

* update css path for dev only

* Update apps/dev/package.json

Co-authored-by: Thang Vu <thvu@hey.com>
2022-09-08 16:43:16 +02:00
Roberto Romero
ba20974b5f fix(providers): use client_secret_post token auth for LinkedIn (#5236)
* Send client_id and client_secret to linkedin

Linkedin now requires client_id and client_secret to be
sent in the oauth callback. Fixes #5220

* Update linkedin.ts

Co-authored-by: Thang Vu <thvu@hey.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-07 17:57:45 +02:00
Anton Starikovich
14b4ed1d8a feat(adapters): let user configure MongoDB database name (#5290)
* feat: added providing database name in options

* fix: added database name providing in readme

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-07 17:56:00 +02:00
Michael Angelo
6b3a82d1f5 docs(providers): Update v4 Strava Doc (#5299)
update
2022-09-07 17:43:13 +02:00
Cristian Muñoz
600aaaa7e6 docs: Update Getting Started Example (#5295) 2022-09-07 17:42:38 +02:00
Michael Angelo
f1d3bc26f9 fix(providers): convert Strava Provider to TS (#5241)
* update strava

* add localhost fallback

* lint & small updates

* Update docs/versioned_docs/version-v3/providers/strava.md

Co-authored-by: Lluis Agusti <hi@llu.lu>

* fix

* Delete yarn.lock

* Apply suggestions from code review

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-06 17:06:51 +01:00
Silvio
78664aab37 docs: close the callback object (#5251)
* Update role-based-login-strategy.md

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-06 17:02:46 +01:00
namacha
aeb3a44b27 docs(tutorial): fixed title of code block (#5282) 2022-09-02 18:32:42 +02:00
Jonny
d3571e01ba fix: Change getToken parameter type to required (#5245)
* changed getToken parameter type to required

* removed redundant nullish coalescing operator

Co-authored-by: Thang Vu <thvu@hey.com>
2022-09-02 12:34:40 +07:00
Esteban Dalel R
3b7c9886c3 docs: fix grammar error (#5254) 2022-09-01 12:04:30 +01:00
dependabot[bot]
39fec738c6 chore(deps-dev): bump vite from 2.8.4 to 2.9.13 in /apps/playground-sveltekit (#5255)
chore(deps-dev): bump vite in /apps/playground-sveltekit

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 2.8.4 to 2.9.13.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v2.9.13/packages/vite)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 12:04:04 +01:00
Daniel
fa58143c6b docs(adapters): Update upstash-redis.md (#5261)
* Update upstash-redis.md

* Update docs/docs/adapters/upstash-redis.md

Co-authored-by: Lluis Agusti <hi@llu.lu>

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-09-01 12:03:52 +01:00
Sean McEmerson
26fb89e3c4 docs: fix broken link (#5263)
Update firebase.md

Fix broken link
2022-09-01 10:44:08 +02:00
Melanie Seltzer
a82cbf5ddf fix: return null in unstable_getServerSession if there's an error (#5218)
* fix: return null in unstable_getServerSession if there's an error

* Remove status check and instead check body is not a string

* Combine similar tests
2022-08-31 09:19:14 +07:00
josef
24db833685 docs(svelte): upgrade SvelteKit playground to use latest SvelteKit routes (#5229)
* feat: migrate routes

* feat: ugrade to latest SvelteKit (443)
2022-08-28 13:32:55 +01:00
Adalberto Prado
c57a810042 docs(nextjs): change typo from js to ts (#5217) 2022-08-26 23:47:09 +01:00
Brian Muenzenmeyer
d980fa986b chore(types): fix typo in comment (#5207) 2022-08-23 18:58:50 +02:00
Greg Rickaby
4676352ae0 docs(providers): Enhance Reddit App Instructions (#5199)
docs(reddit): Enhance App Instructions

Add step-by-step instructions for creating Reddit App. Add screenshot.
2022-08-22 14:50:38 +01:00
rinuya
c8780122b3 docs: typo in "unstable_getServerSession" (#5191)
fixed a typo
2022-08-22 14:44:56 +01:00
Junichi Sato
3131971e2c fix: Use consistent error type between doc, logger and error class (#5046)
* Keep error from being logged twice

The same errors have been logged, firstly before throwing
OAuthCallbackError, later in the catch-clause of it.

This commit removes the former and lets the latter survive,
because logging functionality seems better to reside in the
same neighborhood.

* doc: Merge CALLBACK_OAUTH_ERROR to OAUTH_CALLBACK_ERROR

* doc: This particular error from openid-client comes with SIGNIN_OAUTH_ERROR

* Provide logger with `providerId`

Co-authored-by: Thang Vu <thvu@hey.com>

Co-authored-by: Thang Vu <thvu@hey.com>
2022-08-22 14:46:30 +07:00
heyitsbryanm
448ec1017a docs(adapters): Adds warning to backup database (#5160)
prisma migrate deleted mine, hah.
2022-08-16 17:25:29 +01:00
Soumyajit Pathak
0e9404ebc1 docs: clarify cookie policies in FAQ (#5158)
* fix typo in faq

Added missing “not” in same root different subdomain config section warning text

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-08-16 17:24:50 +01:00
James
d349ae2b1b Feature/nonce check type (#4100)
* feat: add nonce check type

* Update types import for nonce-handler.ts

* Update packages/next-auth/src/core/lib/oauth/callback.ts

Co-authored-by: Thang Vu <thvu@hey.com>

* Add further info to debug msg as per PR suggestion

* Cast OauthChecks as OpenIDCallbackChecks

* Update order of imports as per PR suggestion

Co-authored-by: Hamid Adelyar <hamid.adelyar@bjss.com>
Co-authored-by: hamidbjss <98807568+hamidbjss@users.noreply.github.com>
Co-authored-by: Thang Vu <thvu@hey.com>
2022-08-16 17:07:42 +07:00
Thang Vu
32f4d5000e docs(faq): note default behavior for account linking (#5113) 2022-08-13 15:58:10 +07:00
Dragate
7f2dbfc65b docs: Fix file paths (#5146)
* Correct auth config path

* Fix some relative paths
2022-08-12 21:36:08 +02:00
Moritz Kneilmann
a03657e615 fix(providers): Add appid param to Azure AD wellKnown URL (#5138)
This fixes: #5137
Relevent documentation:
> If the application has custom signing keys as a result of using the claims-mapping feature, append an appid query parameter that contains the application ID to get a jwks_uri that points to the signing key information of the application, which should be used for validation.

https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens#validating-the-signature
2022-08-12 14:26:21 +02:00
Youssef Hajjari
3e312d0df1 docs: Typo fix (#5132) 2022-08-11 12:02:01 +02:00
Shudhanshu Choudhary
d9167bbffe docs: Typo fix (#5114)
* fix typo

* Update docs/docs/configuration/options.md

* fix path for mongodb file

Co-authored-by: Thang Vu <thvu@hey.com>
2022-08-08 21:15:54 +02:00
Shudhanshu Choudhary
526a6c1adc docs: typo in configuration/options.md (#5112)
* fix typo

* Update docs/docs/configuration/options.md

Co-authored-by: Thang Vu <thvu@hey.com>
2022-08-07 15:30:37 +07:00
Eng Zer Jun
ad03a4efc1 docs(middleware): fix default value of pages option (#5091)
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-06 10:17:01 +02:00
Lluis Agusti
424af6cbc5 docs(getting-started): reword NextAuth.js + install (#5081)
* docs: update references to NextAuth

* docs(getting-started): use install snippet
2022-08-04 01:34:09 +02:00
Stephen Gbolagade
a3c6786f78 docs(getting-started): add how to install next-auth (#5040)
Contains the following squashed commits:

* Added how to install next-auth
* Update docs/docs/getting-started/example.md
* Update docs/docs/getting-started/example.md
* Updated with suggestions in mind
* Update example.md
2022-08-03 12:29:06 +02:00
dependabot[bot]
385037ab33 chore(deps): bump next-auth from 4.9.0 to 4.10.3 in /apps/playground-sveltekit (#5071)
chore(deps): bump next-auth in /apps/playground-sveltekit

Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.9.0 to 4.10.3.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Changelog](https://github.com/nextauthjs/next-auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@v4.9.0...next-auth@v4.10.3)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-03 00:32:42 +02:00
Balázs Orbán
26a03da621 chore(release): bump version [skip ci] 2022-08-01 13:55:08 +02:00
Balázs Orbán
afb1fcdae3 fix(providers): add normalizeIdentifier to EmailProvider
* fix(providers): add `normalizeIdentifier` to EmailProvider

* docs: document `normalizeIdentifier`

* fix: allow throwing error from normalizer

* test: add e-mail tests

* chore: log provider id

* test: merge client+config jest configs and add coverage report

* test: show coverage for untested files

* fix: only allow first domain in email. Add tests

* chore: add `coverage` to tsconfig exclude list

* cleanup

* revert

Co-authored-by: Thang Vu <thvu@hey.com>
2022-08-01 13:43:19 +02:00
Gavin Fogel
a21db8950f fix(ts): fix jsdoc link to documentation (#5039) 2022-07-28 06:54:01 +02:00
Daniel González Reina
e8371ab23a docs(providers): update custom Reddit provider to v4 (#4985)
* Update custom reddit provider to v4

* Reuse RedditProvider's default options

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-07-26 10:43:45 +02:00
Visor Web Technologies
9cdeb2ce7d docs: Fixed Typo (#5025) 2022-07-26 10:39:33 +02:00
Thang Vu
89829d8a88 chore: fix unstable_getServerSession usages in dev app (#5017)
chore: fix unstable_getServerSession usages in dev app
2022-07-25 23:08:59 +02:00
Balázs Orbán
aedabc8d3f fix: avoid redirect on always public paths (#5000)
* type safe babel config

* avoid auth redirect for `_next`

* force render default error page on user miconfig

* add slash to _next path

* use `.some`

* add docs

* change from localhost

* add favicon to public path
2022-07-24 00:45:56 +02:00
Balázs Orbán
9f2cdad457 docs: add Thang as point of contact 2022-07-22 20:31:19 +02:00
Yoann Fleury
b107ca4946 docs: update path to gitlab provider (#4997) 2022-07-22 19:33:03 +02:00
Balázs Orbán
6590993fdc chore(release): bump package version(s) [skip ci] 2022-07-21 16:35:03 +02:00
Balázs Orbán
0ea96796b2 fix: improve logger (#4970)
* fix: add debug warning, only show warnings once

* fix: prefer `debug` for details

* remove url

* test: fix tests

* Update docs/docs/errors.md

Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>

* Update callback.ts

Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
2022-07-21 16:00:16 +02:00
Misha Kaletsky
8ec940bd6a docs: highlight archiving of next-auth/react-query (#4964)
* docs: highlight archiving of next-auth/react-query

project is read-only and author said users should just copy-paste the implementation: https://github.com/nextauthjs/react-query/issues/7#issuecomment-923099050

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

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

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

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-07-21 13:59:46 +02:00
Balázs Orbán
e3bcdf83f1 chore: update lock file 2022-07-20 03:18:02 +02:00
Balázs Orbán
4084297334 chore(release): extract release script to its own package 2022-07-20 03:08:03 +02:00
Balázs Orbán
c9827960b1 chore(release): read packages dynamically 2022-07-20 00:36:49 +02:00
Balázs Orbán
946a825865 chore: fix adapters PR auto-labeler 2022-07-19 23:55:03 +02:00
Balázs Orbán
c57d8c997e fix(adapters): set correct peer dependency version of next-auth (#4950)
* fix(adapters): set correct peer dependency version of `next-auth`

* fix fauna peer dependency
2022-07-19 23:46:45 +02:00
Balázs Orbán
e2b92bf04f chore: add newlines to PR comment 2022-07-19 17:45:55 +02:00
Balázs Orbán
8bff050e4e chore(release): bump version [skip ci] 2022-07-19 17:30:40 +02:00
Thang Vu
1a79a1a612 docs: FAQ framework-agnostic & session sharing (#4962)
Split a FAQ into two parts:
Before:
- Can I use NextAuth.js with a website that does not use Next.js?

After:
- Can I use NextAuth.js with a framework different than Next.js?
- Can session generated by NextAuth.js be used by another website?
2022-07-19 17:29:54 +02:00
Balázs Orbán
b7065a602f chore: correct Middleware logic in Next.js example 2022-07-19 17:16:51 +02:00
Balázs Orbán
61b92ec1b6 chore: revert type assertion 2022-07-19 16:57:16 +02:00
Balázs Orbán
282f7ab340 fix(ts): fix Middleware internal type 2022-07-19 16:46:13 +02:00
Balázs Orbán
4f56e414b0 chore: simplify dev app 2022-07-19 16:42:21 +02:00
Yoann Fleury
2725d07eb7 fix(providers): migrate GitLab provider to TS (#4929) 2022-07-17 04:47:15 +02:00
Balázs Orbán
5a8b029523 docs: clarify getToken + secret in example
ref #4954
2022-07-17 04:44:11 +02:00
Balázs Orbán
f62a985848 docs: clarify getToken and secret
Ref: #4954
2022-07-17 04:39:47 +02:00
Balázs Orbán
edd6fb5989 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-07-17 04:29:49 +02:00
Balázs Orbán
fb60554a62 chore(ts): explicitly set next path in next-auth 2022-07-17 04:29:44 +02:00
cobbvanth
9784dfb631 docs: Remove import of "useSession" from wrong location (#4952)
This tutorial snipped erroneously imports useSession from "next-auth/next", when it actually resides in "next-auth/react".
2022-07-16 23:06:00 +02:00
Balázs Orbán
4ff836a8cf test(providers): add fetch polyfill to redis test runs 2022-07-16 17:39:32 +02:00
Balázs Orbán
042955eaaa fix(providers): allow issuer in Azure AD B2C 2022-07-16 14:20:31 +02:00
Balázs Orbán
82e107c0e7 chore: improve dev app DX 2022-07-16 14:19:33 +02:00
dependabot[bot]
f7050347e8 chore(deps-dev): bump svelte from 3.46.4 to 3.49.0 in /apps/playground-sveltekit (#4947)
chore(deps-dev): bump svelte in /apps/playground-sveltekit

Bumps [svelte](https://github.com/sveltejs/svelte) from 3.46.4 to 3.49.0.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/compare/v3.46.4...v3.49.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-15 23:17:21 +02:00
Balázs Orbán
c56abbd745 chore: update CODEOWNERS (#4941)
* chore: update codeowners

* reorganize
2022-07-15 12:35:54 +02:00
Thang Vu
3f6d99e8df chore: add Thang to contributor (#4944) 2022-07-15 12:34:36 +02:00
Balázs Orbán
46eedee3c8 fix(ts): remove TS workaround for withAuth (#4926)
* fix(ts): improve Middleware types

* docs: remove TS workaround for Middleware

* ignore lint

* simplify
2022-07-15 04:39:15 +02:00
Balázs Orbán
bb664a27da fix(providers): typo in GitHub provider scope (#4938) 2022-07-15 04:38:42 +02:00
Balázs Orbán
a14fbea0b5 chore: add TODO comment for next major 2022-07-15 02:41:09 +02:00
Balázs Orbán
4705632c6b chore: add TODO comment for next major version 2022-07-15 02:38:59 +02:00
Balázs Orbán
2296471f02 chore: add pnpm to experimental release comment 2022-07-15 02:20:06 +02:00
S. Suzuki
8853000fd5 fix(ts): handleMiddleware return type can be NextMiddlewareResult (#4818)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-07-14 00:20:19 +02:00
Balázs Orbán
70ffa6592f chore(release): bump package version(s) [skip ci] 2022-07-13 14:16:44 +02:00
mshd
3666e438a3 refactor(providers): convert GitHub provider to TypeScript (#4908)
* rewrite github provider in typescript

* rename md js endings

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

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

* add eslint disable next line

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-07-13 14:07:24 +02:00
Aliaksei Tayanouski
cdf467eba1 fix(providers): fix VK provider and convert to TS (#3709)
* renamed vk provider file extension to .ts

* lint issue fix

* vk provider fix

* formatting fix

* remove user_id from tokens

* Update src/providers/vk.ts

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

* Update src/providers/vk.ts

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

* user interface additions

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-07-13 14:04:55 +02:00
Balázs Orbán
374dc30f9f chore: bump pnpm version requirement 2022-07-13 14:01:25 +02:00
Balázs Orbán
d9534d807d chore: tweak release script 2022-07-13 13:59:45 +02:00
Balázs Orbán
f4c7401a5d chore: fix release script text 2022-07-13 13:09:08 +02:00
Balázs Orbán
2baa0c30c1 chore: bump turbo 2022-07-13 13:08:58 +02:00
Sagar Gajare
839b9108ea docs: provider link fixed (#4913) 2022-07-13 01:39:13 +02:00
Juho Tapio
0bf955a63d docs: a few typos in CONTRIBUTING.md (#4910)
* docs: fixed a typo

* docs: update link to scripts index

* docks: more typos

* docs: added a comma
2022-07-12 17:58:54 +02:00
Balázs Orbán
83a974d455 docs: update Middleware docs
closes #4867
2022-07-12 17:19:23 +02:00
Nico Domino
8f54b8f729 docs: upgrade docusaurus-plugin-npm2yarn2pnpm (#4909) 2022-07-12 16:52:21 +02:00
nkg
1b91282402 fix(ts): use correct type for nodemailer config in the EmailProvider (#4097)
Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
2022-07-12 02:50:09 +02:00
Ryan Barr
c2a9ab3023 fix(providers): convert Discord Provider to TypeScript (#4170)
* chore(providers): Add typings for Discord Provider

* Update DiscordProfile interface to extend Record.
2022-07-12 02:43:56 +02:00
Chancellor Clark
5bd00f6ff1 feat(adapters): update Firebase adapter to use new API (#3873)
Ports and refactors `@next-auth/firebase-adapter` to use the new Adapter API. Ported from this PR: nextauthjs/adapters#183

BREAKING CHANGE:

- Renames `FirebaseAdapter` export to `FirestoreAdpater`
- This adapter now requires firebase v9+
2022-07-12 01:45:06 +02:00
William Crutchfield
af3c2dd33d fix(ts): typo in Azure Active Directory Provider (#4895) 2022-07-11 18:24:09 +02:00
John Brunton
709edc5153 fix(adapters): use correct peer dependency in Sequelize adapter (#4880) 2022-07-11 18:23:04 +02:00
Balázs Orbán
fa3ea37ebc chore: comment out adapter in dev app 2022-07-11 18:20:53 +02:00
Yoann Fleury
6a364f0353 docs: update CONTRIBUTING for pnpm instead of yarn (#4888)
* docs: update CONTRIBUTING for pnpm instead of yarn

* dev:app -> dev

Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
2022-07-11 10:38:30 +07:00
mshd
c22d613774 feat(providers): Add Wikimedia Oauth Provider (#4813)
* Add Wikimedia Oauth Provider

* add docs

* Update wikimedia.md

* Update wikimedia.md

* Update wikimedia.md

Co-authored-by: Nico Domino <yo@ndo.dev>
2022-07-10 19:38:01 +02:00
Nico Domino
9efafcd36c chore: fix dev app URL parse error (#4887) 2022-07-10 14:30:10 +02:00
Misha Kaletsky
e317b16cd2 docs: getToken link (#4884)
fix(docs): getToken link

without `/` it's considered a relative link so goes to https://next-auth.js.org/configuration/tutorials/securing-pages-and-api-routes#using-gettoken which doesn't exist.
2022-07-09 22:46:38 +02:00
Rudy Boutte
2edc79ed2b fix(docs): options page link (#4876) 2022-07-09 12:56:20 +02:00
Balázs Orbán
637dda9966 chore: tweak release script 2022-07-08 19:55:08 +02:00
Balázs Orbán
10bb32c479 chore(adapters): fix MikroORM adapter dependencies 2022-07-08 19:36:24 +02:00
Balázs Orbán
89e25568b1 chore: accept --dry-run flag in release script 2022-07-08 19:31:04 +02:00
Balázs Orbán
88ad25a16b feat(adapters): update typeorm support (#4844)
We haven't kept up with the recent TypeORM changes, and since they are still <1, it's likely that users kept upgrading, even if there were breaking changes.

BREAKING CHANGE:

[`typeorm`](https://github.com/typeorm/typeorm) is still in active development and has not yet published a stable release. Because of this, you can expect breaking changes in minor versions. This release of the adapter expects `typeorm@0.3.7` and is not validated against previous or future releases.

Run `npm i typeorm@latest` and make sure to read the [release notes](https://github.com/typeorm/typeorm/releases) for breaking changes in TypeORM
2022-07-08 19:26:59 +02:00
Luiz Bett
c1f7ce3436 fix(ts): make colorScheme optional (#4868)
Documentation says if it is not passed it will be "auto", but it is mandatory on this type.
2022-07-08 19:24:30 +02:00
sean-nicholas
c59a4e04d1 fix(middleware): allow secret as option in Middleware (#4846)
*  provide secret via config

* 🐛 make secret optional

* 📝 docs for middleware and env var

* 📝  recommendation at the end of paragraph

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-07-07 14:14:21 +02:00
Joshua Grant
3c210d961b feat(providers): add Duende IdentityServer 6 (#4850)
* add duende identity server 6 provider

* Update docs/versioned_docs/version-v3/providers/duende-identity-server6.md

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

* Update docs/versioned_docs/version-v3/providers/duende-identity-server6.md

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

* Update packages/next-auth/src/providers/duende-identity-server6.ts

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

* Update packages/next-auth/src/providers/duende-identity-server6.ts

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

* Update docs/versioned_docs/version-v3/providers/duende-identity-server6.md

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

* Update apps/dev/pages/api/auth/[...nextauth].ts

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

* Update docs/versioned_docs/version-v3/providers/duende-identity-server6.md

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

* Update docs/versioned_docs/version-v3/providers/duende-identity-server6.md

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

* Update packages/next-auth/src/providers/duende-identity-server6.ts

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

Co-authored-by: Joshua <joshua.grant@tempcover.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-07-07 14:12:35 +02:00
Balázs Orbán
9457593038 chore: update Next.js example, bump dependencies 2022-07-07 11:31:17 +02:00
dependabot[bot]
5081d25f5c chore(deps): bump next-auth in /apps/playground-sveltekit (#4859)
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.5.0 to 4.9.0.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Changelog](https://github.com/nextauthjs/next-auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@v4.5.0...next-auth@v4.9.0)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-07 00:34:27 +02:00
Rudy Boutte
384edbab3b docs: Added documentation on how to use a custom base path in NextAuth (#4858) 2022-07-07 00:34:12 +02:00
Balázs Orbán
2adfadefdc chore: bump version 2022-07-06 11:51:37 +02:00
Balázs Orbán
32fa01f939 chore: re-add GITHUB_TOKEN 2022-07-06 11:44:37 +02:00
Balázs Orbán
ae834f1e08 feat(providers): allow styling e-mail through theme option (#4841)
* fix(core): move email handling

* fix: don' use `replaceAll`

* feat(providers): re-use `theme` for e-mail

* docs: mention `theme` option for email

* fix: don't render user e-mail in the email HTML body

* docs: add missing comma

* refactor: fix lint

* refactor: fix lint
2022-07-05 16:02:04 +02:00
Nico Domino
4d4c276627 docs: replace npm2yarn with npm2yarn2pnpm docusaurus plugin (#4805)
* feat: rm npm2yarn add npm2yarn2pnpm plugin

* fix: pnpm-lock.yaml

* chore: test change

* fix: update npm2yarn2pnpm usage

* fix: package.json mistake packages added

* fix: pnpm-lock.yaml

* fix: test debug output

* fix: named import npm2yarn2pnpm

* chore: rm debug:true

* fix: change require statement

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml

* Update pnpm-lock.yaml

* Delete pnpm-lock.yaml

* add pnpm-lock.yaml

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-07-05 11:56:44 +02:00
Junichi Sato
f4c0d5ab5d docs: Correct grammatical error (#4836) 2022-07-05 00:25:46 -04:00
Nico Domino
01cd6b0f7b docs: fix unstable_getServerSession arguments (#4815)
* chore(docs): fix unstable_getServerSession arguments

* chore: add authOptions import
2022-07-03 23:27:37 +02:00
Nico Domino
993c0f46b0 fix: show experimental api warning only in dev and only once (#4816)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-07-02 21:00:11 +02:00
Balázs Orbán
163d8c66e2 chore: bump version 2022-07-01 13:53:57 +02:00
Balázs Orbán
5319dca583 fix(ts): fall back to empty string when parsing cookie 2022-07-01 12:14:48 +02:00
Balázs Orbán
cd6ccfde89 fix(core): handle invalid email 2022-07-01 12:09:57 +02:00
Nico Domino
89d91ea282 chore: update docs regarding new server session API (#4776)
* chore: update docs regarding new server session API

* fix: add note about unstable_ API prefix

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-06-30 05:18:52 -04:00
Balázs Orbán
ca3165bd5a Update README.md 2022-06-29 15:55:54 +02:00
Balázs Orbán
aa527b37bf Update README.md 2022-06-29 15:54:49 +02:00
Richard
f3233641d0 docs: not -> now (#4783)
I assume this is meant to say "is now secured" ?
2022-06-28 19:12:48 +02:00
Balázs Orbán
4bee970775 chore: bump version 2022-06-28 18:28:53 +02:00
Balázs Orbán
80a4f50be2 chore: upgrade Docusaurus (#4782) 2022-06-28 12:55:43 +02:00
Ofek Asido
1f4ffbaefe docs: wrong semicolon placement (#4781) 2022-06-28 12:45:48 +02:00
Balázs Orbán
a911b4a40b chore(deps): upgrade dependencies 2022-06-28 12:22:11 +02:00
Balázs Orbán
cb0f3e1ae2 chore: rename GITHUB_TOKEN to RELEASE_TOKEN 2022-06-28 12:21:58 +02:00
Balázs Orbán
c194261617 fix(core): respect NEXTAUTH_SECRET in unstable_getServerSession (#4774)
* fix(core): respect `NEXTAUTH_SECRET` in `unstable_getServerSession`

* add `secret` tests

* add `@types/jest`

* fix tests
2022-06-27 17:00:08 +02:00
Nico Domino
5fdd8483d8 chore: add security headers to docs vercel.json (#4766) 2022-06-24 14:30:48 +02:00
Balázs Orbán
99f5b9616f fix: update Middleware (#4757)
* merge `main`, fix workspace dependencies

* chore(dev): use `matcher` in Middleware

* fix(middleware): support `cookies` as `Map`

* simplify

* chore(example): use new Middleware API

* chore(example): use `next-auth@latest`

* docs(middleware): document new Middleware API

* docs(ts): update inline example

* fix(ts): make cookies optional

* remove non-null assertion
2022-06-24 14:11:39 +02:00
Michael Hays
d8d9ab94cb feat(core): pass profile to linkAccount event (#4242)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-06-24 12:03:20 +02:00
Nico Domino
e8827cbf45 chore(docs): update securing pages tutorial (#3982)
Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
2022-06-24 10:02:26 +02:00
Balázs Orbán
37c4a813e3 chore: bump version 2022-06-23 16:48:10 +02:00
Balázs Orbán
6a23ff7126 fix(build): include utils in package (#4760)
* fix: include `utils` in package

* fix: import `InternalUrl` as type

* `"emitDeclarationOnly": false`

* don't ignore `types.ts` in build
2022-06-23 16:41:01 +02:00
Balázs Orbán
23db0e68dd chore: bump version 2022-06-23 12:30:56 +02:00
Arthur Pedroti
e03e234b86 fix(ts): infer provider type in signIn (#4679)
* fix: signIn infer provider type

The "P" type it's not passed in any props, so the result type doesn't understand and return the false type always, Adding the "P" at provider type props.

* fix: P possibly undefined

Co-authored-by: arthurpedroti@gmail.com <arthurpedroti@LAPTOP-MVAK9RM5.localdomain>
2022-06-23 12:18:32 +02:00
Thang Vu
66fb914a31 feat: introduce experimental unstable_getServerSession API (#4116)
* refactor: improve `getServerSession` API

* Apply review comment

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

* Apply review comment

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

* Apply review comment

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

* Apply review comment

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

* Apply review comment

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

* Apply review comment

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

* Address docs review

* Fix a typo

* Update lint file location

* Address review comments

* getServerSession -> unstable_getServerSession

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Dragate <spidfair@gmail.com>

* Update packages/next-auth/package.json

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Dragate <spidfair@gmail.com>
2022-06-23 12:15:15 +02:00
Balázs Orbán
8ce728197f chore: update to use release token 2022-06-23 12:10:05 +02:00
ml4den
87d1a7af6d docs(providers): Change env names (#4753)
Proposing to match the env names to what is in the example [...nextauth].ts
2022-06-22 22:23:04 +02:00
Matthew Francis Brunetti
172813f987 docs(adapters): fix references to deprecated adapters repo (#4737) 2022-06-22 18:12:07 +02:00
dependabot[bot]
cc934fceec chore(deps): bump next-auth in /apps/playground-sveltekit (#4746)
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.3.3 to 4.5.0.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Changelog](https://github.com/nextauthjs/next-auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@v4.3.3...next-auth@v4.5.0)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-22 18:07:17 +02:00
Guillermo Villegas Gray
46e467a7cb docs(providers): typo in slack.md (#4733)
typo in slack.md, thanks for the warning though!
2022-06-22 18:06:59 +02:00
Gal Schlezinger
73d489beac fix(edge): support request.cookies as a map (#4745)
in next Next.js versions, NextRequest.cookies will be an instance of NextCookies which is
some kind of a Map, instead of a plain object.

This commit checks whether there's a `get` function in req.cookies, and acts accordingly,
to make sure we will support newer Next.js versions with Edge Functions/Middleware
2022-06-21 20:20:48 +02:00
Balázs Orbán
e498483b23 test: add test for invalid callbackUrl handling 2022-06-20 10:38:21 +02:00
Cody Ogden
7cf49566a6 docs(providers/workos.md): Update reference link. (#4721)
The file extension changed to `.ts`.
2022-06-16 18:38:34 +02:00
Balázs Orbán
2469e44572 feat: allow standard Request in NextAuthHandler (#4704)
* chore: upgrade dev dependencies

* chore: use SWC for test transforms

* feat: allow standard `Request` as `NextAuthHandler` argument

* test: add initial core tests

* chore: ignore `tests` in build

* chore: fix lint

* chore: move `lib` to `utils`

* add body parsing, simplify

* fix tests

* chore: use `NPM_TOKEN_PKG` for experimental release
2022-06-14 12:25:07 +02:00
Danny Luedke
408b6b175f chore(sveltekit): cookie.parse type error for null (#4580) 2022-06-14 00:32:53 +02:00
ike
92dfc3c8b0 fix(providers): use client_secret_post auth method for Instagram (#4705) 2022-06-14 00:23:23 +02:00
Balázs Orbán
8c5d9faad6 chore: bump versions
[skip ci]
2022-06-14 00:10:16 +02:00
Balázs Orbán
49a8d51f79 fix: don't show error on relative callbackUrl
fixes #4700
2022-06-12 14:37:04 +02:00
Balázs Orbán
c0d251731d chore: bump version 2022-06-10 14:52:05 +02:00
Balázs Orbán
76560aed5a chore: no git checks on publish 2022-06-10 14:39:43 +02:00
Balázs Orbán
25517b7315 fix: handle invalid callbackUrl 2022-06-10 13:52:00 +02:00
Tom Freudenberg
4daa63d5e1 feat(callback): return always status code 401 on error (#4601) 2022-06-09 18:43:50 +02:00
Chris Betz
81afeef194 feat(provider): Add United Effects provider (#4546)
* Adding United Effects as a provider
* Update packages/next-auth/src/providers/united-effects.ts
* returning name and image as null in profile response

Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-06-04 00:03:23 +02:00
Or Linzer
008f29e6f8 docs(next): Update config comment (#4664)
* Update Custom JWT decode method
* Update docs/docs/configuration/nextjs.md

Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-06-03 23:53:19 +02:00
Balázs Orbán
e4ee520b4a fix(ts): allow getToken in getServerSideProps (#4659) 2022-05-31 19:05:35 +02:00
Balázs Orbán
358b80d4ce feat(providers): make issuer configurable on Salesforce (#4658) 2022-05-31 19:02:35 +02:00
Balázs Orbán
0a7a916228 fix(ts): remove unused type (#4657) 2022-05-31 18:55:34 +02:00
Balázs Orbán
612c35e8c2 Revert "fix(ts): signIn infer provider type (#4623)" (#4655)
This reverts commit 46089eb5ae.
2022-05-31 18:44:54 +02:00
Thomas Knickman
9f6949816c chore(release): increase checkout depth (#4654)
Fetch two commits in CI so HEAD^1 is able to function correctly to determine diff between last commit and now.
2022-05-31 18:37:22 +02:00
Arthur Pedroti
46089eb5ae fix(ts): signIn infer provider type (#4623)
The "P" type it's not passed in any props, so the result type doesn't understand and return the false type always, Adding the "P" at provider type props.
2022-05-31 18:29:34 +02:00
42Atomys
7d8cc70faf feat(middleware): support custom cookieName (#4385)
* feat: Add the support of custom cookieName on the next-auth/middleware

* chore: Only accept used params based on NextAuthConfig

* docs: Remove duplicated docs

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-05-31 18:29:15 +02:00
Thanh Nhan
75602a3f04 fix(middleware): use relative URL for sign-in page callbackUrl (#4534)
* Use relative URL for middleware's signin callbackUrl

* Include params to callbackUrl if any

* For testing purpose, append params to existing link for test instead of create another one

* Update apps/dev/components/header.js

Co-authored-by: CODY Mai <nhan.mai@shiftasia.com>
Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
2022-05-31 18:14:24 +02:00
Shubham Jain
5b8a619cd0 docs: Remove trailing '/' from Authentik issuer example (#4646)
The Authentik provider already adds a `/` after the `issuer`, so this creates a double slash that causes a NextAuth `SIGNIN_OAUTH_ERROR` ("expected 200 OK, got: 301 Moved Permanently").
2022-05-31 18:13:32 +02:00
Alvin Li
16622f6428 feat(middleware): support custom jwt.decode (#4210)
* feat: custom jwt decode method for middleware

* Update docs/docs/configuration/options.md

Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>

Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-05-31 17:45:37 +02:00
dependabot[bot]
e203801f30 chore(deps): bump next-auth in /apps/playground-sveltekit (#4615)
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.3.2 to 4.3.3.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Changelog](https://github.com/nextauthjs/next-auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nextauthjs/next-auth/compare/next-auth@v4.3.2...next-auth@v4.3.3)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-26 11:06:46 +02:00
Nico Domino
cfc0a55080 docs: add note to ensure pages actually exist (#4618)
* chore(docs): add note to ensure pages actually exist

* Update docs/docs/configuration/options.md

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

* Update docs/docs/configuration/pages.md

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-05-25 14:33:05 +02:00
mohammed hussam
dda4e0a7d8 docs: update blog link (#4591)
Authentication Patterns for Next.js is moved official next.js docs https://nextjs.org/docs/authentication#authentication-patterns
2022-05-20 19:48:52 +02:00
PalanikannanM
374f886e84 chore(tutorial): fixing the expires_in method of account object to expires_at (#4540)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-05-19 22:28:07 +02:00
Ephraim Atta-Duncan
db188b872f docs: update screenshot (#4571) 2022-05-17 10:10:17 +02:00
Matías Aguilera
2838dd7e0f docs: fix font size for small devices (#4558)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-05-14 23:55:03 +02:00
Imamuzzaki Abu Salam
08f6b31e41 missing "role" in the first sentence (#4560) 2022-05-14 09:36:01 +02:00
rgsthethird
602668f93c Small grammar fix (#4531)
'this environment variable must be set', instead of 'this environment variables must be set'.
2022-05-13 12:20:55 +02:00
Nico Domino
641d917175 chore: update test script and turborepo dependency (#4490)
Co-authored-by: Thang Vu <31528554+ThangHuuVu@users.noreply.github.com>
2022-05-07 13:35:46 +02:00
Nico Domino
70d59bb6e7 chore(docs): fix formatting / syntax (#4523) 2022-05-07 12:19:42 +02:00
Nico Domino
0c86d5a370 chore(docs): rm sandpack - unused (#4521) 2022-05-07 00:18:00 +02:00
Glenn Streetman
0ac8773c2b docs(tutorial): Adding role based login to database session strategy (#4449)
Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: ndom91 <yo@ndo.dev>
2022-05-07 00:13:42 +02:00
Nico Domino
714579e8d6 chore: update docs dependencies (#4522) 2022-05-07 00:01:02 +02:00
Negotiamini
8b6d2e3972 fix(types): typo (#4504) 2022-05-05 19:03:48 +02:00
Thang Vu
4f29d39521 chore: move to pnpm (#4420)
* feat: pnpm

* Update publish script

* gitignore the pnpm debug log

* Fix workspace

* Fix dev commands

* feat: pnpm

* Update publish script

* gitignore the pnpm debug log

* Fix workspace

* Fix dev commands

* chore: fix pnpm install in GitHub Action

* fix: update tsconfig path

* pnpm run -> pnpm

* chore: remove cache-node and add back setup-node

* fix: tsconfig dependencies

* chore: fix tsconfig path

* fix: adapter-test dependencies

* fix: setup-node for release-pr

* fix: import adapter-test

* chore: update workspace dependency for next-auth

* fix: test failure

* fix: add jest for adapters

* fix: jest again

* fix: mongo in prisma

* fix: `--no-git-checks` for `release-pr`

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-05-03 15:05:55 +02:00
Erica Pisani
042ed82ca0 docs: update Netlify section (#4489)
The build plugin now sets the NEXTAUTH_URL environment variable automatically
when it detects that 'next-auth' is installed in the project.
2022-05-02 00:36:56 +02:00
Jiří Hofman
a6901db11b docs: fix typo (#4488) 2022-04-29 12:25:59 +02:00
Lluis Agusti
0b953bd047 test(signout): fix skipped test (#4484) 2022-04-28 14:19:53 +02:00
Lluis Agusti
268c0636d7 chore(github): update PR template (#4482) 2022-04-28 13:28:35 +02:00
Balázs Orbán
c6903d3e85 chore. bump version 2022-04-28 12:18:48 +02:00
Balázs Orbán
a74d215745 Revert "fix: loosen env variable URL fallback (#4443)" (#4481)
This reverts commit d4fb7af6f5.
2022-04-28 11:50:29 +02:00
Kot
18174fae36 docs: Clarify code_challenge_method RFC requirement (#4464) 2022-04-28 11:45:31 +02:00
Balázs Orbán
d4fb7af6f5 fix: loosen env variable URL fallback (#4443)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-04-28 11:42:40 +02:00
dependabot[bot]
bc15e2866e chore(deps): bump next-auth in /apps/playground-sveltekit (#4451)
Bumps [next-auth](https://github.com/nextauthjs/next-auth) from 4.2.1 to 4.3.2.
- [Release notes](https://github.com/nextauthjs/next-auth/releases)
- [Changelog](https://github.com/nextauthjs/next-auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nextauthjs/next-auth/compare/v4.2.1...next-auth@v4.3.2)

---
updated-dependencies:
- dependency-name: next-auth
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-28 11:42:18 +02:00
Jonas Strassel
aee5ec2e4f docs: remove redudant and deprecated doc (#4475)
... as `session.jwt` has been replaced with `session.strategy: 'jwt'`
2022-04-28 11:42:06 +02:00
Balázs Orbán
f0ed23acf6 fix: allow react@18 as peer dependency 2022-04-28 11:35:14 +02:00
Lluis Agusti
fb4bbc3b08 fix(ts): handle NextRequest type (#4472)
* fix(jwt): handle NextRequest

* fix(cookie): Headers from fetch request

* Update packages/next-auth/src/jwt/index.ts

* fix: tests

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-04-28 11:22:49 +02:00
Smultar
4c832f855e Fixes 404 error, when visiting the options link (#4462)
The current link leads to nowhere.
2022-04-25 16:57:30 +02:00
Nico Domino
e3ace6e649 chore: add SIWE and signin example links (#4463)
* chore(docs): add link to SIWE example app / tutorial

* chore(docs): add link to example signin page and cleanup

* chore: update copy for SIWE credentials provider example
2022-04-24 14:18:03 +02:00
Jon Parton
8a75911567 fix(client): update 'signin' page error example (#4412)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-04-22 18:24:33 +02:00
Lluis Agusti
8288ae5be8 fix(providers): profile types (#4202) 2022-04-22 13:15:24 +02:00
Jiyeol Lee
9f40cd1bd9 fix(client): add additional type (#4402)
* Add additional type
* do not cast to 'any' anymore
* add missing import
* import NextRequest from next/server

Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-04-22 13:10:10 +02:00
Thang Vu
39b4d62336 docs: remove error event in config options (#4406) 2022-04-22 10:38:26 +02:00
Balázs Orbán
1faae313fa docs: update callbacks 2022-04-20 19:27:01 +02:00
Balázs Orbán
e71118b996 chore: bump versions 2022-04-20 19:07:54 +02:00
Balázs Orbán
afdb3c8d7c fix: more strict default callback url handling 2022-04-20 18:52:24 +02:00
Raúl Marín
fd755bc29e fix(signin): set email sign-in input to "email" & "required"(#4352)
* fix(core\pages\signin.tsx): set type of built-in email sign-in input to email for browse validation
* fix(core\pages\signin.tsx): add required attribute to built-in sign-in email input

Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-04-15 19:12:01 +02:00
Yisu Kim
59daa0e43f fix(providers): add optional chaining to avoid nullish reference errors (#4365) 2022-04-14 16:35:54 +02:00
Simon Kirsten
58d06ed727 fix: Cleanup global __NEXTAUTH state after unmount (#4383) 2022-04-14 16:35:10 +02:00
Salah Eddine
82159d3e8f docs: remove auth from keycloack url (#4391)
in keycloak 17.0+ , There's a change in endpoints as per the official documentation (https://www.keycloak.org/docs-api/11.0/rest-api/index.html#_users_resource) .
so the new url well be https://my-keycloak-domain.com/realms/My_Realm
2022-04-14 16:28:21 +02:00
Balázs Orbán
abb9fed7aa chore: bump versions 2022-04-14 11:09:32 +02:00
Balázs Orbán
5471c0f675 chore: use --no-workspaces
See: https://github.com/npm/cli/issues/4605#issuecomment-1076900100
2022-04-14 11:03:27 +02:00
Balázs Orbán
b2da0b38d4 chore: add --verbose 2022-04-14 10:54:20 +02:00
Balázs Orbán
b3b8d4be46 chore: log npm config list 2022-04-13 18:05:21 +02:00
Balázs Orbán
182e118d9b chore: else 2022-04-13 15:19:18 +02:00
Balázs Orbán
7183b06939 chore: write .npmrc 2022-04-13 15:18:35 +02:00
Balázs Orbán
bd10e87bf4 chore: more visible log 2022-04-13 15:08:14 +02:00
Balázs Orbán
d07abfe517 chore: log 2022-04-13 15:00:44 +02:00
Balázs Orbán
c1110cdc98 chore: don't write .npmrc 2022-04-13 14:35:57 +02:00
Balázs Orbán
8ed038d891 chore: revert 2022-04-12 17:05:40 +02:00
Balázs Orbán
b25425795b chore: CI=1 2022-04-12 17:01:16 +02:00
Balázs Orbán
ad1650a817 chore: no brackets 2022-04-12 16:52:09 +02:00
Balázs Orbán
a4a487a22a chore: NPM_TOKEN_PKG 2022-04-12 16:46:26 +02:00
Balázs Orbán
b30de36126 chore: remove cat 2022-04-12 16:36:38 +02:00
Balázs Orbán
41e4e515ad chore: cat .npmrc 2022-04-12 16:35:12 +02:00
Balázs Orbán
cde1f82e3c chore: revert 2022-04-12 16:26:55 +02:00
Balázs Orbán
c39782007b chore: pkg vs org? 2022-04-12 16:22:33 +02:00
Balázs Orbán
984a089c15 chore: ignore .npmrc 2022-04-12 16:10:04 +02:00
Balázs Orbán
26f8b8c1f1 chore: remove npm whoami 2022-04-12 16:09:27 +02:00
Balázs Orbán
afc9b43c53 chore: npm whoami 2022-04-12 16:03:02 +02:00
Balázs Orbán
cdbd9ac2e6 chore: manually upgrade dep version 2022-04-12 15:39:55 +02:00
Balázs Orbán
3d8cc316f1 chore: debug release script 2022-04-12 15:32:50 +02:00
Balázs Orbán
3b8c568f79 chore: trigger deploy 2022-04-12 15:22:57 +02:00
Balázs Orbán
16668d307d docs: revert 2022-04-12 14:17:00 +02:00
Balázs Orbán
6e15bdcb2d fix: update default callbacks.redirect 2022-04-12 14:14:35 +02:00
Yisu Kim
7a4bf038b1 Update callbacks.md (#4361)
missing async keyword
2022-04-09 22:23:26 +02:00
Francis Gulotta
11ad64f617 docs: add google oauth URI examples (#4347)
* docs: add google oauth URI examples

* Update docs/docs/providers/google.md

Co-authored-by: Lluis Agusti <hi@llu.lu>

Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-04-09 09:45:55 +02:00
Francis Gulotta
0a278b9297 docs: callbacks can now be relative (#4346)
* docs: callbacks can now be relative

since v4 anyway

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

Co-authored-by: Lluis Agusti <hi@llu.lu>

Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-04-09 09:45:19 +02:00
Francis Gulotta
8c8070f30b docs(client): fix type in signIn examples (#4308) 2022-04-07 12:58:06 +02:00
Christopher Reece
6442d089c1 docs(adapters): update providerAccount to account (#4329) 2022-04-07 12:45:41 +02:00
Francis Gulotta
63398d4c3f docs: Update JWT docs to reflect JWE changes in v4 (#4313)
* docs: Update JWT docs to reflect JWE changes in v4

This PR https://github.com/nextauthjs/next-auth/pull/3039 changed the defaults for JWT tokens to be encrypted by default (JWE). We have conflicting documentation across the docs site and readme.

Additionatlly this PR https://github.com/nextauthjs/next-auth/pull/3783 made providing a secret required in production via NEXTAUTH_SECRET or an option.

* Missed a reference

* Update docs/docs/faq.md

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

* Update docs/docs/faq.md

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

Co-authored-by: Nico Domino <yo@ndo.dev>
2022-04-05 12:48:06 +02:00
Oliver Terbu
0d54170e83 feat: added siwe tutorial (#4276)
Co-authored-by: Oliver Terbu <oliver@awoie.local>
2022-04-04 22:52:55 +02:00
Francis Gulotta
174f0d6aec chore(docs): fix Custom Client Session Handling example (#4310)
* docs: fix Custom Client Session Handling example

It made reference to a useEffect call that was no longer needed.

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

Co-authored-by: Lluis Agusti <hi@llu.lu>

Co-authored-by: Lluis Agusti <hi@llu.lu>
2022-04-04 22:11:59 +02:00
Francis Gulotta
f91b9dc03d docs: Add some more context to the adapters page (#4303)
Link the models to the adapters page to provide some context about what is passed into each function.

Co-authored-by: Nico Domino <yo@ndo.dev>
2022-04-02 12:48:19 +02:00
Sriram Jothiswaran
8763e4aeb9 chore(docs): update prisma mongodb connector required modifications (#4304)
* Update for Mongodb prisma connector 

In reference to https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#model-field-scalar-types, for scalar type String the native MongoDB type attribute is @db.String.

* Update prisma.md
2022-04-02 12:48:06 +02:00
Danny Luedke
e936c51575 Fix API directory (#4283)
Update the API directory from `pages/api/[...nextauth].ts` to `pages/api/auth/[...nextauth].ts`  so it matches the typescript example.
2022-03-29 22:44:24 +02:00
dependabot[bot]
8d7ba75bca chore(deps): bump minimist in /apps/playground-sveltekit (#4261)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 11:18:36 +02:00
dependabot[bot]
67038b4022 chore(deps): bump node-forge from 1.2.1 to 1.3.0 (#4262)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/digitalbazaar/forge/releases)
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 11:18:24 +02:00
dependabot[bot]
5b7ce98a87 chore(deps): bump minimist from 1.2.5 to 1.2.6 (#4263)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 11:18:07 +02:00
Chandler GREFF
1c468f057d docs: fix return type in jwt decode example (#4273) 2022-03-28 11:17:52 +02:00
Nico Domino
ef22c5b835 chore(docs): add carbon ads to docs sidebar (#4250)
* chore(docs): add carbon ads to docs page

* fix: add carbon-wrap element

* fix: script in docusaurus config object

* fix: add _carbonads_js id

* fix: add script directly to sidebar

* fix: carbon ads style

* chore: bump ad container down a bit
2022-03-25 19:24:05 +01:00
Grégory D'Angelo
a912739b24 chore(docs): add full stack course (Next.js/NextAuth.js/Supabase/Prisma) (#4086)
* Add free course ""

* Adjust new entry formatting to comply with all the other resources in the page

Co-authored-by: Nico Domino <yo@ndo.dev>
2022-03-23 19:50:26 +01:00
Nico Domino
ae318788c3 chore(docs): fix broken tutorial links (#4241) 2022-03-23 19:32:24 +01:00
1000101
affa459fcc fix(docs): v3->v4 migration (#4039)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-03-23 19:18:23 +01:00
Nico Domino
b88a31ef1a chore(docs): add tutorial for avoiding corporate email scanning HEAD reqs (#3900)
* chore(docs): add tutorial for avoiding corporate email scanning HEAD requests breaking email invitations

* fix: move to internal guides section
2022-03-22 23:29:05 +01:00
Nico Domino
bc82d6555a chore(docs): add corporate proxy tutorial (#3931)
* chore(docs): add corporate proxy tutorial

* fix(docs): add details about provider proxy adjustments

* fix: add to internal guides section
2022-03-22 23:27:14 +01:00
Thang Vu
11954567c2 docs: fix markdown link in jwt options (#4197)
Co-authored-by: Nico Domino <yo@ndo.dev>
2022-03-22 22:55:21 +01:00
Thang Vu
6e28ccf84f chore(adapters): Add next-autth as devDependencies for adapters (#4226)
* Upgrade turborepo, add next-auth as dev deps

* Fix TS error

* Update adapters.json

* ignore linting
2022-03-21 21:26:37 +01:00
Deepak Prabhakara
f542b400ba updated port number (5000 is blocked by MacOS AirPlay) (#4221) 2022-03-19 09:30:21 +01:00
Piyush Priyadarshi
d1b76bc302 docs: remove unused negation operator (#4217) 2022-03-18 22:28:43 +01:00
Andreas Thomas
3f396be5d9 feat(deps): upgrade minimal peer dependency @upstash/redis@v1 (#4213)
BREAKING CHANGE

From now on, you will need a minimum version of `@upstash/redis@v1` installed if you want to use this adapter.

You can upgrade by running `npm i @upstash/redis@latest` or `yarn add @upstash/redis@latest`
2022-03-18 22:27:45 +01:00
Balázs Orbán
bf4916dd70 chore: manually bump versions 2022-03-17 19:24:08 +01:00
Balázs Orbán
5100784d72 chore: update tsconfig 2022-03-17 19:03:26 +01:00
Balázs Orbán
3853e16268 chore: downgrade turbo 2022-03-17 18:57:46 +01:00
Balázs Orbán
4c0cc9e614 chore: manually bump package versions
since the last automatic release failed to do so
2022-03-17 18:38:20 +01:00
Balázs Orbán
d0112aae61 chore: upgrade lock file 2022-03-17 16:49:37 +01:00
Balázs Orbán
e373ff2473 chore: exclude firebase 2022-03-17 15:03:39 +01:00
Balázs Orbán
6d6d0a8679 Merge branch 'main' of github.com:nextauthjs/next-auth 2022-03-17 13:51:39 +01:00
Balázs Orbán
8152752cc8 chore: exclude firebase from testing 2022-03-17 13:51:31 +01:00
Andreas Thomas
966381ac9b docs: pin @upstash/redis version to 0.2.1 (#4201)
Until we migrate to v1 there might be people installing the latest
version of @upstash/redis and then encountering errors.
With this they will at least get a warning.

This is obsolete and should be updated once
https://github.com/nextauthjs/next-auth/issues/4183 is resolved.

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-03-17 13:44:21 +01:00
Wayne Shih
8199c96b76 fix: update font-family stack (#4192) 2022-03-17 13:43:08 +01:00
Balázs Orbán
6a06b8e054 chore: ignore building firebase adapter 2022-03-17 13:41:58 +01:00
Thang Vu
68bab17914 fix: set module to commonjs for adapters (#4205)
* fix: set module to commonjs for adapters

* Update tsconfig.json

* Update tsconfig.json

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-03-17 13:36:25 +01:00
Nico Domino
47b4765941 docs: 1st party guides section (#4167)
* chore: simplify example-gatsby readme header

* chore(docs): move 1st party guides to own section
2022-03-16 00:01:29 +01:00
Simon Kirsten
6d45ad4840 fix: encode callbackUrl for custom sign-in page (#4174) 2022-03-15 23:57:52 +01:00
Alexandru Călin
e5e49aca1c docs(adapters): add dynamoDB cf ProjectionType (#4182) 2022-03-15 23:54:50 +01:00
Lluis Agusti
ea944ebb86 docs(oauth): use Mermaid for the diagram (#4147) 2022-03-15 23:54:19 +01:00
Balázs Orbán
ca8af7fcd5 chore: push tags before GitHub release 2022-03-15 23:13:08 +01:00
Balázs Orbán
c9e74f435c chore: remove dry run flag 2022-03-15 22:54:43 +01:00
Balázs Orbán
c2601430fa fix: remove action from bad request response 2022-03-15 22:39:25 +01:00
TheBestMoshe
5b08e084a5 chore(docs): fixed broken link (#4189) 2022-03-15 22:07:51 +01:00
Balázs Orbán
6b9333d4ee docs: Remove false cookie size limit claim
Fixed with cookie chunking in v4
2022-03-15 16:02:06 +01:00
William Crutchfield
7636de4a34 Update provider links in oauth.md (#4175)
Noticed some links we're still looking for the files pre-monorepo
2022-03-14 02:55:13 +01:00
Nico Domino
ad2609d313 chore(docs): bump docusaurus dependencies (#4168)
* chore: simplify example-gatsby readme header

* chore(docs): upgrade docusaurus deps

* chore: dummy commit - will revert

* chore: revert dummy commit

* chore: revert rm searchParameters option

* chore: more dummy update 🤦

* chore(docs): new aloglia apiKey

* chore(docs): revert dummy update
2022-03-12 20:31:37 +01:00
Danilo Woznica
454add250c chore(docs): Adds Sandpack integration (#3880)
Co-authored-by: ndom91 <yo@ndo.dev>
2022-03-12 19:51:23 +01:00
Nico Domino
90b4dbc194 chore: simplify note header (#4166)
* chore: simplify note header

* chore: simplify example-gatsby readme header

* chore: fix broken docs README badge

* chore: rm docs README prerelease shield
2022-03-12 18:09:22 +01:00
Israel Ortiz
8783b17fc2 docs: update to v4 session object to strategy: "jwt" (#4159)
I saw in the documentation that v4 now uses
  session: {
    strategy: "jwt"
  },
instead of 
  session: {
    jwt: true
  },

also there was double ;; at the end of the return statement, fixing it
2022-03-12 05:48:26 +01:00
boulatbek
3585c8e0c3 docs: Update initialization.md (#4158)
minor edit to the text to remove redundant words
2022-03-12 05:46:06 +01:00
Balázs Orbán
1be87d40af docs: warn in Credentials 2022-03-09 18:41:41 +01:00
Theo Tarr
c64aebcd4f docs: space formatting for redirect callback example (#4131) 2022-03-07 13:16:38 +01:00
Deepak Prabhakara
001354eaa8 feat(providers): add BoxyHQ SAML provider (#3782)
* added saml-jackson provider

* incorporated code review changes

* fixed SAMLJacksonProfile type

* trying to adjust code for monorepo

* cleanup from merge with main

* updated docs link

* added example

* consistent naming

* Incorporated code review changes:
- env var default values moved to env.local.example
- consistent naming and use of id

* email is guaranteed to be present
2022-03-05 23:52:55 +01:00
天阙
b0935c7b4a docs: fix typo for bungie.md (#4098) 2022-03-03 07:13:43 +01:00
Thang Vu
2ea5566d1e docs(adapters): update overview.md (#4092) 2022-03-01 18:47:46 +01:00
Thang Vu
755904d5ae chore: add WorkOS to readme.md (#4091) 2022-03-01 14:45:20 +01:00
Balázs Orbán
d66d963e86 fix: ensure Prisma/MongoDB integration (#4083)
* chore(deps): upgrade Prisma

* fix: ignore `id` when not needed

* test: ensure MongoDB/Prisma integration

* test: remove table mappers

* docs(adapters): mention MongoDB in the Prisma adapter

* docs: plural

* fix: `@ts-ignore`

* docs: typo, consistency
2022-03-01 05:52:56 +01:00
Lluis Agusti
6f30b7aeb5 docs(getting-started): explain callback URL (#4065)
* docs(getting-started): explain callback URL

* docs(getting-started): refer to existing guide

* fix: grammar

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

* fix: grammar

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

* fix: grammar

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-03-01 03:02:14 +01:00
Pumidol Leelerdsakulvong
d69969894e docs(providers): fix link on 42 School page (#4062)
* UPDATE documentation

UPDATE incorrect import 
ADD callback uri information

* Update docs/docs/providers/42.md

Co-authored-by: Lluis Agusti <hi@llu.lu>

* Update docs/docs/providers/42.md

Co-authored-by: Lluis Agusti <hi@llu.lu>

* Update docs/docs/providers/42.md

Co-authored-by: Lluis Agusti <hi@llu.lu>

* Apply suggestions from code review

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-03-01 03:01:30 +01:00
DiamondeX
2a4d45c665 docs: Update securing-pages-and-api-routes.md (#4085)
I'm not sure, but it looks like the `null`  should be returned in case of server-side run, that is with `typeof window === "undefined"`
2022-03-01 02:00:07 +01:00
Balázs Orbán
05803ba36c fix: deduplicate id, return correct updated data (#4082)
* chore: remove `:wip` suffix from scripts

* fix: deduplicate id, return updated data

* chore: revert change

* refactor: deduplicate `id` in `updateSession`

* chore(deps): upgrade to `mongo@4.4.0`
2022-03-01 01:40:27 +01:00
dependabot[bot]
8dca4c87ab chore(deps): bump prismjs from 1.26.0 to 1.27.0 (#4077)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.26.0 to 1.27.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.26.0...v1.27.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-28 00:51:19 +01:00
Novezeil
04383aee9b docs: fix providers overview page link in readme.md (#4079) 2022-02-28 00:51:05 +01:00
Balázs Orbán
9a86bd38cf chore: disable coverage, fix dynamodb jest config 2022-02-28 00:50:42 +01:00
Balázs Orbán
f1af3ffae7 chore: make upstash tests dependent on env variables 2022-02-28 00:34:54 +01:00
Balázs Orbán
d9bb3ce94b chore: update Turbo, clean up scopes 2022-02-28 00:29:14 +01:00
Balázs Orbán
2a36da8278 chore: enforce build before publish 2022-02-28 00:13:06 +01:00
ANTARES
0a267d9a72 fix(ts): SignInAuthorisationParams -> SignInAuthorizationParams (#4072) 2022-02-25 23:56:10 +01:00
Colin Jones
bc401657a6 fix(ts): make refresh_token nullable (#4064)
This field is already nullable in the database, so this should only
affect types.

Because the type is being widened, not narrowed, this should also be
fully backwards-compatible, since pre-existing custom entities of type
`string` will be substitutable for the new default type of `string |
null`.

See #4055 for more specifics on the impact.
2022-02-25 03:20:08 +01:00
Maxime VAST
86b7bfdcdc docs: update auth0 and vercel config documentation (#4049)
* docs: update auth0 and vercel config documentation

* Update docs/docs/configuration/options.md

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-24 00:07:32 +01:00
Nico Domino
83a9867cbc docs: small css update (#4053) 2022-02-23 14:42:01 +01:00
Balázs Orbán
1f07ff05d6 docs: fix lint 2022-02-23 00:49:51 +01:00
Balázs Orbán
163149b424 fix(providers): fix BattleNet 2022-02-23 00:40:56 +01:00
Balázs Orbán
4234742d90 fix(providers): issuer instead of region 2022-02-23 00:30:22 +01:00
Lluis Agusti
3ddfff7808 docs(client): explain basePath on <Provider /> (#4012)
* docs(client): explain `basePath` on <Provider />

* fix: grammar

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-23 00:24:38 +01:00
Karl Stoney
75cb175259 fix: Switch BattleNet to OIDC (#4015)
* Fixes: https://github.com/nextauthjs/next-auth/issues/4013

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

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

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

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

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

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

* Apply suggestions from code review

* Update battlenet.ts

* Update battlenet.ts

* Update battlenet.ts

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-23 00:20:31 +01:00
Jonas Strassel
21f410425b docs: typo thge -> the (#4046) 2022-02-23 00:09:36 +01:00
Robert Soriano
3d0c68d9e0 docs: add SvelteKit playground (#4023)
* docs: add SvelteKit playground

* docs: update readme

* add svelte2tsx for packaging

* remove header component in lib folder

* reexport next-auth functions

* remove as strings

* format svelte files

* update README

* format files

* add hook usage in readme

* Update README.md

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

* Update README.md

Additional info for sveltekit + nextauth.js experimental project

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

* Update global.d.ts

Remove sample github client id and secret

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

* Update .env.example

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

* Update example route

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

* remove .npmrc

* remove pnpm lockfile

* move prettier config to package.json

* reformat files

* Add secret config

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

* remove packaging related lines and files

* remove package command

* Update next-auth.ts

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-21 22:34:46 +01:00
Thang Vu
03ba6683c7 chore: Replay cache output for next-auth (#4025) 2022-02-21 22:24:19 +01:00
AlexRay
3ec3761634 docs(dgraph): fix syntax error in secure schema auth rule (#4024) 2022-02-21 02:03:24 +01:00
Balázs Orbán
e9c1059f3c chore: ignore docs in turbo build 2022-02-21 01:57:03 +01:00
Balázs Orbán
906b7930e8 chore(docs): fix linting 2022-02-21 01:50:12 +01:00
Balázs Orbán
45861548c2 chore: tweak Turbo 2022-02-21 01:40:13 +01:00
Balázs Orbán
0c0a070d6f refactor(adapters): code clean-up 2022-02-20 01:11:21 +01:00
Thang Vu
3f528b03ff chore: exclude tests from release artifact (#4011)
* chore: exclude tests from release artifact

Update base.json

* Symlink readme
2022-02-19 17:00:08 +01:00
Jonas Strassel
e87d5a61f8 feat(adapters): simplify mikro-orm configuration (#4008)
* feat(mikro-orm): simplify mikro-orm configuration

* docs(mikro-orm): clean up the mikro-orm docs

* chore(deps-dev): bump mikro-orm deps

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-19 01:25:45 +01:00
Balázs Orbán
fb8874d6d8 fix: only warn when using Twitter + OAuth 2.0 (#4003) 2022-02-19 00:39:35 +01:00
Thang Vu
692fafeafb chore: separate build commands for core and app (#3845)
* chore: separate build commands for core and app

* Move emitDeclarationOnly to next-auth

* Update release.yml

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-19 00:38:59 +01:00
dependabot[bot]
b6bf2366e2 chore(deps): bump next from 12.0.9 to 12.1.0 (#4005)
Bumps [next](https://github.com/vercel/next.js) from 12.0.9 to 12.1.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v12.0.9...v12.1.0)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-18 06:21:11 +01:00
dependabot[bot]
a9ef2292eb chore(deps): bump vm2 from 3.9.5 to 3.9.7 (#3979)
Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.5 to 3.9.7.
- [Release notes](https://github.com/patriksimek/vm2/releases)
- [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patriksimek/vm2/compare/3.9.5...3.9.7)

---
updated-dependencies:
- dependency-name: vm2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-17 02:19:04 +01:00
Nico Domino
846a0a0f9d docs: move database model to mermaid (#3839)
* chore: move database model to mermaid

* chore: update model details

* chore: update docusaurus dependencies

* chore: add model notes

* chore(docs): fix broken links

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-16 00:12:27 +01:00
Thang Vu
bb37c29218 chore: improve caching dependencies (#3971) 2022-02-15 04:02:09 +01:00
Balázs Orbán
cea444b2b9 docs: move database migration under Adapter 2022-02-15 01:07:36 +01:00
Nico Domino
17314b9b2f docs: add v4 migration script for adapters (#3874)
* chore: add v4 migration script for adapters

* chore: cleanup

* chore: PR comments

* chore(docs): add mongodb migration example + fix nextauthjs/adapters links
2022-02-15 01:00:38 +01:00
Balázs Orbán
fda6d4ab44 chore: enforce double quotes with Prettier 2022-02-15 00:48:14 +01:00
Balázs Orbán
ff84151a02 chore: description first 2022-02-15 00:18:00 +01:00
Balázs Orbán
02f0335e18 chore: tweaks in contributors docs page 2022-02-15 00:16:22 +01:00
Balázs Orbán
5ec3713f20 chore: update contributors docs page 2022-02-15 00:09:09 +01:00
Balázs Orbán
22d3f707e9 chore: rename issue template, add triage label 2022-02-14 20:11:44 +01:00
Balázs Orbán
2d87da454d chore: add docs issue template 2022-02-14 20:08:54 +01:00
Balázs Orbán
614d9cc433 chore: tweaks on release script 2022-02-14 03:01:11 +01:00
Balázs Orbán
9aed24fb4b chore: remove duplicate from issue template dropdown 2022-02-14 02:45:21 +01:00
Balázs Orbán
1c2b573933 chore: pin down repo-file-sync until bug fixed
See https://github.com/BetaHuhn/repo-file-sync-action/issues/168
2022-02-14 02:33:50 +01:00
Balázs Orbán
da840e5461 chore: correct package paths, improve dry run 2022-02-14 02:19:12 +01:00
Balázs Orbán
be9555e6cf chore: force order on issue templates 2022-02-14 01:32:43 +01:00
Balázs Orbán
a18ea2245f chore: minor fixes on issue templates 2022-02-14 01:31:07 +01:00
Balázs Orbán
39f947365d chore: improve maintenance (#3969)
* chore: clean up stalebot config

* chore: introduce issue labeler bot

* chore: clean up PR labeler bot

* chore: clean up bug report process

* chore: add space

* chore: add links to docs in provider/adapter issue templates

* chore: add triage label to feature request issue template
2022-02-14 01:25:50 +01:00
dependabot[bot]
582a4924fa chore(deps): bump follow-redirects from 1.14.7 to 1.14.8 (#3965)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-13 19:34:18 +01:00
Jonas Strassel
7feda249a9 feat(deps): drop mikro-orm <5 support (#3875)
Co-authored-by: Balázs Orbán <info@balazsorban.com>

BREAKING CHANGE

With this release, we only support `@mikro-orm/*@5`

To migrate, run the following (replace the `*` with [your driver](https://mikro-orm.io/docs/installation)):

```sh
npm install @mikro-orm/core@5 @mikro-orm/*@5
```

Check out the [MikroORM v5 changelog](https://github.com/mikro-orm/mikro-orm/blob/master/CHANGELOG.md#500-2022-02-06) for more details.
2022-02-13 19:32:59 +01:00
Balázs Orbán
d0cf5786f1 chore: move changelog generation to publish 2022-02-13 19:03:32 +01:00
Balázs Orbán
fe08b5c8f1 chore: write new version to package.json even in dry run 2022-02-13 18:30:15 +01:00
Balázs Orbán
caa9a17fc8 fix(providers): refactor WorkOS to work in v4 (#3886)
* refactor(dev): moved dev app

* chore(dev): fix dev app

* fix(providers): WorkOS to TS, use `client_secret_post`

* chore: decrease test concurrency

* chore: remove org

* chore: run tests sequentially

* feat(providers): use `picture` in WorkOS if available
2022-02-13 17:56:01 +01:00
Balázs Orbán
2e371053c2 chore: add release script (#3891)
* chore: fix `next-auth` version in `package.json`

* chore: add WIP publish script

* chore: fix comments, add TODOs

* chore: set newer TS target

* chore: extract release config

* chore: WIP work on publish script

* chore: finish up release script

* chore: do not push unless not dryRun

* chore: add debug env var, return early if no package to update

* chore: remove unnecessary comment

* chore: remove changeset and unused dependencies

* chore: drop `semantic-release`

* chore: remove `jsonfile` dependency

* chore: address code review

* fix: list other commits in changelog when releasing

* chore: fix env variable references

* chore: fetch with tags and commit history

* chore: fix analyze code

* chore: fix utils script

* chore: better changelog formatting

* chore: fix package path

* chore: fix some remaining stuff

* chore: remove DEBUG flag
2022-02-13 17:36:15 +01:00
Balázs Orbán
8d410abdc9 chore: fix typo an issue template 2022-02-13 00:49:59 +01:00
Balázs Orbán
a4c619e358 chore: link to discussions from issue template 2022-02-13 00:49:03 +01:00
Balázs Orbán
53433db493 chore: note that feature requests are converted 2022-02-13 00:39:17 +01:00
Sean McEmerson
7c10f380a0 docs: Typo correction for type import (#3914)
Fix incorrect JWT type import path.
2022-02-11 21:50:28 +01:00
Thang Vu
68e412b063 chore: fix Github action error with yarn (#3903)
Restore action name
2022-02-10 16:39:27 +01:00
Mads Thines
7434fb919a docs: Update getting-started/example.md (#3904)
Shouldn't this also be set to inline-code block?
2022-02-10 16:38:44 +01:00
Thang Vu
a9a3f60cb7 chore: Attempt to improve cache speed (#3893) 2022-02-10 02:02:20 +01:00
Balázs Orbán
a7c55b752f chore(dev): move dev app to apps workspace (#3888)
* chore: move dev app

* chore: run tests sequentially
2022-02-09 01:12:24 +01:00
Balázs Orbán
cbf9622e6f chore: move docs to top-level (#3887)
* chore: move docs to top-level

* chore: add docs back to workspaces
2022-02-09 00:42:11 +01:00
Zach Grimaldi
9dc591290a docs(adapters): split Fauna setup commands into two sections (#3877)
* feat(docs): Fauna Adapter setup commands split into two sections

* fix: removed extraneous newline from my contribution
2022-02-08 02:06:59 +01:00
Nico Domino
e062f338e3 chore: add Lowdefy opencollective sponsor (#3876) 2022-02-07 20:13:12 +01:00
Balázs Orbán
5c1826a8d1 docs(example): add Gatsby example, move Next.js example (#3872)
* docs: add Gatsby example, move Next.js example

* chore: fix sync action

* docs(example): fix README link
2022-02-07 18:03:51 +01:00
Balázs Orbán
953712ceaa chore: skip PR when syncing to example repo 2022-02-06 23:31:56 +01:00
Balázs Orbán
c43d1903cf docs: make syncing note more prominent 2022-02-06 23:22:16 +01:00
Balázs Orbán
ef769523bc chore: move example (#3861)
* chore: sync LICENSE file

* chore: move example repository into monorepo

* change to public repository

* add ntoe about source

* change order
2022-02-06 23:18:48 +01:00
Balázs Orbán
3b5ee252bd Update sync.yml 2022-02-06 23:00:28 +01:00
Balázs Orbán
e9dee0af44 chore: add sync config (#3860) 2022-02-06 22:59:29 +01:00
Brian Muenzenmeyer
83232710fd docs(oauth): fixes typo in comment (#3856) 2022-02-06 22:21:09 +01:00
Manny Becerra
87332b3c2e docs: Typo correction (#3857)
On the configuration->options docs, `Promise` has a typo instance that this PR fixes.
2022-02-06 22:20:49 +01:00
Salah Azzouz
40ad78a3ec docs: fix typo in NEXTAUTH_SECRET (#3854)
Fix the misspelling of  'NEXT_AUTG' to 'NEXT_AUTH', the misspelling was found in the JWT Helper section.
Link: https://next-auth.js.org/configuration/options#jwt-helper
2022-02-06 15:29:16 +01:00
Thang Vu
0c91e7f3e3 chore: update contributing docs (#3844)
* chore: update contributing docs

* Mention node version

* Update CONTRIBUTING.md

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

* Update CONTRIBUTING.md

* chore: alias `yarn dev:app` with `yarn dev`

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-06 15:14:09 +01:00
Balázs Orbán
878fe84e29 chore: expose UPSTASH env vars to test runs 2022-02-06 15:10:08 +01:00
Balázs Orbán
8ad90b3eb0 docs: move encode/decode to advanced options (#3849)
* docs: move `encode/decode` to advanced options

* chore: change docs label to documentation
2022-02-06 14:07:29 +01:00
Nico Domino
4d63aa6a41 chore: add adapters issue template (#3807)
* chore: add adapters issue template

* fix: cleanup existing issue templates

* fix: add adapter auto labels

* fix: balazs als docs owner

* Update .github/ISSUE_TEMPLATE/adapters.yml

* feat: add incorrect info disclaimer line

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-05 14:39:28 +01:00
Nico Domino
76c1c4cd72 chore: update readme packagephobia (#3838) 2022-02-05 14:38:46 +01:00
Balázs Orbán
3571031820 Update deployment.md 2022-02-05 14:28:41 +01:00
Brian Muenzenmeyer
4d866373fd docs(faq): fixes typo (#3835)
Noticed this while reading the docs.
2022-02-05 03:02:40 +01:00
Nico Domino
2db3db6ff9 docs: update README for monorepo (#3832)
* fix: update README for monorepo

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-04 22:42:40 +01:00
Nico Domino
dc3ad8c408 chore: move adapters to monorepo (#3805)
* feat: move adapters repo to new packages dir

* fix: rm docusaurus build dir

* fix: update .gitignore

* fix: reorganise package directories

* remove package lock files

* fix: folder rename

* remove package lock file

* fix: jest config paths

* update yarn.lock

* ignore dynamodb local bin

* fix: gitignore

* fix: update adapter-test

* change adapter-test package json

* rename prisma adapter package name

* fix paths

* update gitignore

* run tests with one concurrency

* fix: merge conflicts

* gitignore dist folders

* fix: add jest.config.js to tsconfig ignore

* fix: yarn.lock

* fix: ignore pouch in turbo commands

* ignore jest file

* fix: test turbo test cmd

* fix: turbo test cmd

* test: disable mongodb-adapter temporarily

* ignore all dev.db files

* simplify gitignore

* remove unused dependency

* have tsconfig in its own package

* remove unnecessary .gitignore files

* move jest config to preset

* add ts expect error comment

* chore: update .gitignore

* remove babelrc

* don't depend on build for testing in turbo

* fix: cleanup testing npm scripts

* fix: remove jest-config roots

* fix: add fauna jest preset

* fix: rm dev.db from prisma mirgation

* fix prisma

* remove nohoist

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-04 22:40:32 +01:00
Balázs Orbán
cb30f49f9b docs: fix docusaurus edit link and Vercel path 2022-02-04 16:14:18 +01:00
Balázs Orbán
3fe7a64e7a chore: monorepo 1 (#3804)
* fix labeler

* try fixing test runs in GitHub Actions

* pass flags to test command

* test version pr

* move versoin-pr action

* remove --dry-run flag

* re-enable testing, re-add semantic release for now

* add docs

* use `yarn.lock` and different docs port

* simplify dev app config

* fix coverage report

* fix provider source links

* fix more links
2022-02-04 16:01:26 +01:00
Thang Vu
a72f1b6d21 chore: Convert to monorepo (#3788)
* chore: convert to monorepo

* Remove eslint, typescript, semantic-release

* Add yarn.lock

* Add turbo

* Run test command

* Move to src

* Add a seperate tsconfig file

* Update .gitignore

* Update commands to yarn

* Replace semantic-release with changesets

* Update changesets usage

* Fix commands: dev, setup, clean

* Add back changes from main

* Fixed HMR

* Update .gitignore
2022-02-04 13:40:04 +01:00
Balázs Orbán
f7fc562b49 fix(middleware): handle no argument case (#3799)
* fix(middleware): handle no argument case

* use absolute URLs

* use origin instead of host
2022-02-04 00:27:51 +01:00
Balázs Orbán
f3be5e87f6 feat(middleware): introduce withAuth Next.js method (#3657)
* feat(middleware): introduce Middleware API to Next.js

* chore(app): upgrade Next.js in dev app

* chore(dev): add Middleware protected page to dev app

* chore(middleware): add `next/middleware` to `exports`

* fix(middleware): bail out redirect on custom pages

* fix(middleware): allow one-line export

* chore(middleware): simplify code

* fix(middleware): redirect back to page after succesful login

* feat(middleware): re-export `withAuth` as `default`

* chore: export middleware from `next-auth/middleware`

* chore: add `middleware` files to npm

* feat(middleware): handle chaining, fix some bugs

* chore(dev): showcase different middlewares

* chore(middleware): remove `@ts-expect-error` comments

* chore: update build clean script

* fix: bail out when NextAuth.js paths

* refactor: be more explicit about `initConfig` result

* refactor: simplify

* refactor: use `callbacks` similarily to `NextAuthOptions`

* refactor: use `nextauth` namespace when setting `token` on `req`

* refactor: don't allow passing `secret`

* addressing review
2022-02-03 18:07:26 +01:00
Dinil Fernando
844c9b147c feat(providers): add Trakt provider (#3771)
* added trakt provider

* fixed incorrect auth url

* Update src/providers/trakt.ts

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

* Update src/providers/trakt.ts

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

* Update trakt.ts

Co-authored-by: caidenwilson <caidenwilson@protonmail.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-02-03 15:27:05 +01:00
Balázs Orbán
c9e16fb71e fix(core): only show Twitter OAuth 2 warning once 2022-02-02 16:06:14 +01:00
Balázs Orbán
a7d34f97c8 fix(providers): properly warn when using Twitter OAuth 2 (#3784)
* fix(providers): properly warn when using Twitter OAuth 2

* refactor(providers): move Twitter OAuth2 warning to `assert`

* fix: use proper warning code

* refactor: only set boolean
2022-02-02 12:37:17 +01:00
Balázs Orbán
f20d6790c8 feat(core): detect NEXTAUTH_SECRET (#3783)
* feat(core): detect `NEXTAUTH_SECRET` env variable

* chore(dev): use detected `NEXTAUTH_SECRET` in dev app
2022-02-02 02:08:56 +01:00
Norbert Szabó
53baf6d67d feat(ts): strongly type sign-in and error page errors (#3740)
* feat: added types for sign in errors

* feat: adding type to error prop

* chore: added documentation links to types
2022-02-02 02:08:44 +01:00
dependabot[bot]
255c822dfb chore(deps): bump node-fetch from 2.6.6 to 2.6.7 (#3777)
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.6 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.6...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-01 08:18:26 +01:00
inshatan
31c03c96d1 typo in redirect url for response with error (#3758) 2022-02-01 08:18:09 +01:00
dependabot[bot]
74df39a678 chore(deps-dev): bump next from 12.0.7 to 12.0.9 (#3764)
Bumps [next](https://github.com/vercel/next.js) from 12.0.7 to 12.0.9.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v12.0.7...v12.0.9)

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

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-01 08:16:25 +01:00
Balázs Orbán
714d80a4f5 Update package.json 2022-01-25 18:39:58 +01:00
Balázs Orbán
3d5c669a05 Update bug_report.yaml 2022-01-25 18:37:30 +01:00
Balázs Orbán
29977f108f Update bug_report.yaml 2022-01-25 18:36:56 +01:00
Balázs Orbán
7d2e16a6bb Update bug_report.yaml 2022-01-25 18:35:54 +01:00
Seiji Takahashi
af157dac07 feat(react): add refetchOnWindowFocus option to SessionProvider (#3730) 2022-01-25 18:06:37 +01:00
Alex Johansson
1bf56a218e fix: Allow React 18 as peer dependency (#3728)
Avoid peer dependency warning when using React 18
2022-01-25 18:02:53 +01:00
David Chalifoux
4824f8c02a fix(providers): Check for valid profile picture response before converting to base64 (#3656)
* Fix: Add OpenID to authorization scope

* Fix: Check for valid profile picture response before converting to base64

* Update src/providers/azure-ad.ts

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

* Confirm that profile photo was returned

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-20 02:09:04 +01:00
PAKKU-Chan
a4d831d1b9 feat(providers): add authentik provider (#3625)
* Added authentik provider

* Removed idToken
2022-01-19 01:38:46 +01:00
David Chalifoux
59985264a2 fix(providers): use openid scopes by default (#3651) 2022-01-17 04:28:15 +01:00
Iftekhar Rifat
c844296982 fix: pass csrf & callbackUrl cookies in session api (#3607) 2022-01-17 00:41:16 +01:00
Jon Bellah
d1aa2a1a8e fix(ts): match GoogleProfile interface with Google docs (#3643) 2022-01-17 00:40:23 +01:00
Balázs Orbán
8139126f29 fix(core): detect Vercel without NEXTAUTH_URL (#3649)
* fix(core): detect Vercel without `NEXTAUTH_URL`

* chore(ts): use `any`

* chore: use `process.env.VERCEL` to detect Vercel
2022-01-17 00:37:30 +01:00
Laxmikanta Nayak
aa0e8200b3 docs: Updated the wrong link to providers list in readme (#3616)
The link to providers list was 404 so updated to the correct link in document.
2022-01-15 04:44:31 +01:00
Thang Vu
82447f8e3e fix: display inline errors when using custom error page. (#3576) 2022-01-10 11:57:27 +01:00
Balázs Orbán
a0b3814c81 feat: better out-of-the-box id_token detection (#3514)
* feat: better out-of-the-box `id_token` detection

* fix: check for `scope` on correct endpoint

* chore: simplify internal typing
2022-01-10 11:50:45 +01:00
Balázs Orbán
90c7d535c0 feat(providers): add support to Twitter OAuth 2.0 (#3446)
* feat(providers): add support to Twitter OAuth 2.0

* docs: add docs comment

* chore: cleanup

* chore: remove comments

* chore: give warning for OAuth 2 for now
2022-01-10 11:49:43 +01:00
Tetedeiench
0510c9b1ba feat(providers): add Patreon provider (#3581)
* Added patreon provider - tested and working

* Update src/providers/patreon.js

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

* Update src/providers/patreon.js

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

* Update src/providers/patreon.js

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

* Update src/providers/patreon.js

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

* Switched to TS, restore .env.local, restore package.json as per comments on the PR

* chore: ran Prettier

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-10 11:48:11 +01:00
Changsoon Bok
49e4af17e2 fix(providers): refactor naver provider profile (#3500)
* fix(providers): refactor naver provider profile

fix(providers): refactor naver provider profile

* fix(providers): convert typescript - naver provider profile

fix(providers): convert typescript - naver provider profile

* chore(providers): use nested interface for consistency

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-10 11:35:53 +01:00
Changsoon Bok
db65afe5ab fix(providers): fix url and auth method for Kakao provider (#3501)
* fix(providers): fix url and auth method for Kakao provider

* fix(providers): convert typescript - Kakao provider

fix(providers): convert typescript - Kakao provider

* chore(providers): use nested interface for consistency

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-10 11:31:55 +01:00
Changsoon Bok
36ca1f99e3 docs: update contributing guide link (#3595) 2022-01-10 11:22:58 +01:00
Thang Vu
9bec96784f chore(dev): add postinstall in app to remove next-auth (#3575) 2022-01-08 00:43:38 +01:00
Thang Vu
227ff2259f chore: add eslintIgnore in package.json (#3548)
* fix: add eslintIgnore in package.json

* Let eslint runs in app, config + js files

* Add a separate tsconfig.eslint.json file

We want to run the lint command on `app`, `src` and `config`, but at the same time want `tsc` to compile files in `src` only. A separate `tsconfig.eslint.json` is a suitable solution to satisfy both `eslint` and `tsc`: 04d1f3e549/packages/parser/README.md
2022-01-05 04:02:03 +01:00
Yves Fridelance
c71cb8457d fix(oauth): set httpOptions before issuer discovery (#3537)
* Update client.ts

Set custom.setHttpOptionsDefaults before Issuer.discover(.wellKnown). This allow discover the .wellKnown endpoint behind a proxy

* chore: address code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-02 00:04:23 +01:00
krautwigundrüben
a09a75be53 fix(providers): make Strava work again (#3520)
* Update strava.js

Auth with Strava was throwing errors before, this works.

* Update strava.js

changed according to commenters' suggestions

* chore: run linter

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-01-02 00:00:33 +01:00
Balázs Orbán
c4936991e5 chore(app): upgrade dev app dependencies 2021-12-31 00:41:59 +01:00
Thang Vu
e2add6a597 chore(dev): fix start email script (#3541) 2021-12-30 22:42:26 +01:00
Adam Kaczmarek
0e8be0c7d2 docs: fix OpenCollective link in README.md (#3494) 2021-12-22 00:42:21 +01:00
Ivan Esteban
d1d2d977fe fix(providers): use idToken by default in Cognito provider (#3448) 2021-12-18 02:21:20 +01:00
Kirankumar Ambati
48749d7320 fix(pages): remove default placeholder for credentials provider (#3451)
* fix #3449: removed default placeholder for credentials provider

* fix: formatting
2021-12-18 02:10:05 +01:00
Drew Miller
87d0beb70c fix(jwt): use authorization header as fallback (#3453)
If the `req` sent to `getToken` doesn't have the relevant cookies, use
the Bearer token in the Authorization header as a fallback.

Fixes #3452
2021-12-16 13:37:03 +01:00
Balázs Orbán
978e2eeb08 chore(dev): minor fixes on dev app 2021-12-11 21:19:12 +01:00
Balázs Orbán
8ab057ea33 chore(deps): ugprade dependencies (#3415) 2021-12-11 21:17:22 +01:00
Bogdan Soare
2c269a6a81 fix(providers): use id_token by default on Okta provider (#3418) 2021-12-11 12:52:40 +01:00
Alessandro Cuppari
8b9a109255 fix(providers): refactor FusionAuth to v4 (#3376)
* feat: updated fusionauth provider

* Updated fusionauth profile interface docstring

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

* Refactored openid well know logic

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

* Removed jwks endpoint property

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-12-09 21:48:01 +01:00
Etienne Martin
ac35d9f739 docs: Fix README.md typo (#3412) 2021-12-09 16:53:17 +01:00
Balázs Orbán
30a0fc6bc0 fix: properly handle callback URL fallback (#3402)
* fix: don't default to localhost on `host`

* fall back to `host` for `callbackUrl`

* use parsed host

* remove unnecessary type cast
2021-12-08 18:20:33 +01:00
Balázs Orbán
b0f6175cec chore(deps): upgrade next dev dependency 2021-12-08 17:50:25 +01:00
Balázs Orbán
1c7fe57edb fix: default to VERCEL_URL for callbackUrl 2021-12-08 17:43:49 +01:00
Balázs Orbán
59797bbdef fix: use VERCEL_URL by default for secureCookie (#3399) 2021-12-08 17:22:57 +01:00
Paul Büchner
9eb78a9de9 chore: fix typo in comment (#3388) 2021-12-08 03:07:26 +01:00
Balázs Orbán
2670bbb28f docs: match docs page wording for SECURITY.md 2021-12-06 21:05:41 +01:00
DmitryScaletta
0431c2a334 fix(ts): improve types for encode/decode functions (#3346)
* fix: improve types for encode/decode functions

* fix: use Awaitable type for encode/decode functions
2021-12-04 02:09:48 +01:00
Rraji Abdelbari
5ac688cc18 fix(providers): convert 42 School profile id to string (#3351) 2021-12-04 02:08:48 +01:00
Anthony Ringoet
8ea75f0c1c fix(ts): typo in Auth0Profile interface (#3347) 2021-12-04 02:06:23 +01:00
dnikomon
4dcdb62dca fix: remove nextauth from authorization params (#3332)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-12-02 19:43:42 +01:00
Nico Domino
1f4b7d8089 chore: add opencollective to package.json (#3333) 2021-12-02 12:50:14 +01:00
Balázs Orbán
fedb84872d docs: add top contributors to package.json 2021-12-01 16:44:20 +01:00
Balázs Orbán
c0dddfb77f docs: upgrade README 2021-12-01 16:40:21 +01:00
Balázs Orbán
50fe115df6 Release v4 2021-12-01 16:32:35 +01:00
Jameel Khan
cc17ddf8aa fix: Fallback to --color-text when no color-brand (#3313) 2021-12-01 15:01:11 +01:00
Balázs Orbán
8644e553ed Merge branch 'main' into beta 2021-11-30 19:20:56 +01:00
Nisala Kalupahana
d1d0db43ea feat(providers): ensure GitHub provider always gives an email (#3302)
* Ensure that GitHub provider always gives an email

* Update src/providers/github.js

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-11-29 23:58:49 +01:00
Balázs Orbán
b01f6805d3 chore(providers): TS improvements (#3295) 2021-11-28 17:52:56 +01:00
Balázs Orbán
c44b860b9e feat(providers): refactor Apple provider (#2875)
* chore: remove legacy code

* fix(providers): refactor Apple provider

* chore(dev): add Apple provider

* docs(providers): add `generateClientSecret` to JSDoc

* fix(providers): use `jose@4`

* fix(providers): use seconds since epoch, correct sign

* chore(providers): move secret generator into a script
2021-11-28 17:52:24 +01:00
Khánh Hoàng
22f74d7c4d fix(providers): correct authorization url for Atlassian (#2999)
* fix(provider): correct authorization for Atlassian

* feat(providers): use wellKnown for better configuration

* fix(atlassian): switch back to raw config

* fix(providers): pass generic to `OAuthUserConfig`

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-11-28 15:49:24 +01:00
Balázs Orbán
2570168660 fix: add custom error message when session required (#3288) 2021-11-28 15:38:02 +01:00
Balázs Orbán
187a1474f5 feat(oauth): expose httpOptions (#3287) 2021-11-26 23:40:58 +01:00
Kevin McKernan
4dc76749f2 fix(providers): Rewrite EVEOnline in TS, fix default scopes (#2759)
* refactor EVEOnlineProvider into typescript, fix default scopes

* Update src/providers/eveonline.ts

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

* update to new OIDC SSO endpoints

* set idToken: true

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-11-26 19:20:40 +01:00
Torben
35ee608d59 feat(providers): add Osu! provider (#3234) 2021-11-20 14:49:51 +01:00
Estevan Jantsk
0f132de115 feat(providers): add Pipedrive provider (#3011)
* Add Pipedrive as a provider

* convert pipedrive provider to ts

* remove others interface

* refactor(pipedrive): run prettier

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-11-17 23:07:29 +01:00
Balázs Orbán
31426b9435 fix(providers): match filename with 42 Provider's id (#3225) 2021-11-17 23:03:56 +01:00
Balázs Orbán
64b2a2c43b fix: assert action when req.query isn't available (#3222)
* fix: assert `action` if `req.query` unavailable

* refactor: make `method` externally optional
2021-11-17 22:47:12 +01:00
Balázs Orbán
7beb3ff03b refactor(providers): cleanup 42 (#3221) 2021-11-17 10:15:59 +01:00
Richard van der Dys
432876c011 fix(providers): refactor Zoom
* Added support for zoom in beta

* Converted to typescript

* rename

* Now reflects response from Zoom

* chore: Prettier

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-11-16 23:37:03 +01:00
Balázs Orbán
15d1fab4c8 fix: correct assertion when Credentials only (#3217) 2021-11-16 23:16:12 +01:00
Rraji Abdelbari
5e803cd34c refactor(providers): convert 42 to TypeScript (#3211) 2021-11-16 21:57:53 +01:00
Balázs Orbán
76bf524e8e feat: make missing secret an error (#3143)
BREAKING CHANGE:

It is now required to set a `secret` in production.
2021-11-15 18:45:56 +01:00
Balázs Orbán
f9e0ef8d18 feat: introduce chunking when session cookie becomes too big (#3101)
If the expected cookie size would exceed the 4096 bytes most browsers allow, we split up the cookie value and put the content into multiple cookies, then assemble it upon reading it back. This eliminates the need for a database or user-land solutions in case the user wants to save more data or is constrained by their IdP for certain fields.
2021-11-15 10:30:26 +01:00
Rraji Abdelbari
38cefdd548 fix(providers): set 42 default scope (#3189)
With no scope defined, it sets `openid` by default, which is an invalid 42 scope.

Co-authored-by: Alaa Zorkane <alaazorkane@gmail.com>

Co-authored-by: Alaa Zorkane <alaazorkane@gmail.com>
2021-11-13 11:14:29 +01:00
Balázs Orbán
b871b47d8b fix: allow configuring http timeout (#3188) 2021-11-12 12:58:08 +01:00
Balázs Orbán
043b252940 refactor: decouple CSRF-state (#3142)
* refactor: decouple csrf token from state

* refactor: simplify pkce-handler
2021-11-11 22:30:19 +01:00
Balázs Orbán
e9ac11b4b2 fix: respect host in getServerSession (#3179) 2021-11-11 11:27:14 +01:00
Balázs Orbán
ba39efb256 feat: rename session strategy (#3144)
BREAKING CHANGE:

The `session.jwt: boolean` option has been renamed to `session.strategy: "jwt" | "database"`. The goal is to make the user's options more intuitive:

1. No adapter, `strategy: "jwt"`: This is the default. The session is saved in a cookie and never persisted anywhere.
2. With Adapter, `strategy: "database"`: If an Adapter is defined, this will be the implicit setting. No user config is needed.
3. With Adapter, `strategy: "jwt"`: The user can explicitly instruct `next-auth` to use JWT even if a database is available. This can result in faster lookups in compromise of lowered security. Read more about: https://next-auth.js.org/faq#json-web-tokens

Example:

```diff
session: {
-  jwt: true,
+ strategy: "jwt",
}
```
2021-11-07 21:06:10 +01:00
Balázs Orbán
6502b63e9c feat: allow relative redirects (#3140) 2021-11-07 17:40:13 +01:00
Balázs Orbán
0d7d8da2d9 fix: use error query param if set (#3141) 2021-11-07 17:37:09 +01:00
Mathis Møller
f998bf2768 refactor: strict types (#2802)
* WIP strict types

* wip types

* wip strict types

* More strict typing

* Removing strict false
Fix last types

* Fix typo

* Make TS happy

* Fix tests

* Fixes to types

* Make files align with strict mode
2021-11-04 20:01:45 +01:00
Kovacs Nicolas
78fa33312f docs(readme): opencollective domain (#3066)
I had 502 using `opencollective.org` for some time, also, the correct domain looks like `opencollective.com`
2021-11-04 08:16:30 +01:00
Nico Domino
533ed949b3 feat: Clerk to README supporters
Added Clerk to supporters section!
2021-11-03 22:53:38 +01:00
Balázs Orbán
1597369d30 fix: correctly transpile all client-side submodules (#3100) 2021-11-03 18:31:02 +01:00
Balázs Orbán
41819882be fix(oauth): allow 10 sec clock tolerance (#3071) 2021-10-31 14:57:25 +01:00
Srijan Sharma
b66afcc5cc fix: normalize URL before parsing (#3077) 2021-10-31 10:35:02 +01:00
Filip Skokan
da991de8a4 fix: bump openid-client (#3063)
fixes #3052
2021-10-29 14:10:14 +02:00
Balázs Orbán
1d9b7b82b9 feat(react): preserve history on client-side navigation (#2980)
* feat(react): preserve history on client-side navigation

* chore(deps): upgrade jest

* test(client): use absolute URL since `whatwg-*` refusing relative URLs
2021-10-29 12:55:53 +02:00
Filip Skokan
c089ede3af refactor: use universal modules in next-auth/jwt (#3062) 2021-10-29 12:45:47 +02:00
Thang Vu
5725931406 fix(providers): add default id_token_signed_response_alg to LINE (#3059)
* Add default value for client in Line Provider

* Migrate to TypeScript
2021-10-29 10:33:25 +02:00
Haye
c8b7e2e3cb fix: uuid import (#3056) 2021-10-28 22:33:13 +02:00
Filip Skokan
72408ab7d7 feat: update jose and openid-client (#3039)
Updates the `jose` and `openid-client` packages.

BREAKING CHANGE:

The `jwt` option has been simplified and the NextAuth.js issued JWT is now encrypted by default.

If you want to override the defaults, you can still use the `encode` and `decode` functions. These are advanced options and they should only be used if you know what you are doing.

The default secret generation has been removed in this PR, which will be added back in a separate one. Remember, that is only for developer convenience, it is **highly** recommended to always create your own secret for production.
2021-10-27 22:09:46 +02:00
Balázs Orbán
eb33c9db1d refactor: decouple Next.js from core (#2857)
* refactor: decouple Next.js from core (WIP)

* refactor: use `base` instead of `baseUrl`+`basePath`

* fix: signout route

* refactor(ts): convert files to TS

* fix: imports

* refactor: convert callback route

* fix: add `next` files to package

* chore(dev): alias npm email

* refactor: do not merge req with user options

* refactor: rename userOptions to options

* refactor: use native `URL` in `parseUrl`

* refactor: move Next.js specific code to `next` module

* refactor(ts): return `OutgoingResponse` on all routes

* fix: change `base` to `url`

* feat: introduce `getServerSession`

* refactor: move main logic to `handler` file

* chore(dev): showcase `getServerSession`

* feat: extract `sessionToken` from Authorization header

* fix: pass headers to getServerSession

* refactor: rename `server` to `core`

* refactor: re-export `next-auth/next` in `next-auth`

* fix: add `core` to npm package

* fix: re-export default method

* feat: return `body`+`header` instead of `json`,`text`

* feat: pass `NEXTAUTH_URL` as a variable to core

* refactor: simplify Next.js wrapper

* feat: export `client/_utils`

* fix(ts): suppress TS errors
2021-10-27 16:11:58 +02:00
Tania
932d05da70 docs: mention other repos in readme and issue forms (#2989)
* Update bug_report.yaml

Add information about distributing issues to the correct repo

* fix yaml syntax

* remove new line

* improve content

* Import content

* remove one emoji

* Update feature_request.yaml

* Update README.md
2021-10-22 09:40:18 +02:00
Balázs Orbán
58a98b667d fix(providers): resize default AzureAD profile picture (#2910)
* Update azure-ad.js

* fix: default azure AD profile photo size

Co-authored-by: ndom91 <yo@ndo.dev>
2021-10-10 18:47:51 +02:00
Thang Vu
129d161115 fix(providers): Refactor Line Provider (#2917)
* feat(providers): Refactor Line Provider

* Use static wellKnown + retrieve email

* Remove issuer
2021-10-08 16:09:38 +02:00
Nico Domino
19e326e8e2 fix: conditionally render theme logo on builtin pages (#2916)
* fix: conditionally render theme logo

* fix: add dispaly to render span

* fix: theme-logo img display
2021-10-08 04:43:53 +02:00
Balázs Orbán
a0b9577267 chore(deps): upgrade dependencies (#2900) 2021-10-06 01:42:29 +02:00
Balázs Orbán
dfff2e692f fix: correctly set authorization url for OAuth1 (#2884) 2021-10-03 15:26:14 +02:00
Balázs Orbán
5149a5d865 chore: trigger CI 2021-10-03 13:29:49 +02:00
Gegham Zakaryan
0707ba663b fix(signin): Set default input type to text to fix CSS (#2881) 2021-10-03 01:01:34 +02:00
Gegham Zakaryan
c5bd99d92a feat(signin): Support passing any argument to credentials input (#2876)
Spreading the object into the input tag allows developers to specify any attribute for the input tag used in the builtin sign-in page, such as 'autocomplete', 'autofocus', etc.

Removed the hardcoded attributes which just set the defaults of the 'input' tag and won't cause any behavior change in case they are absence from the object.

Signed-off-by: Gegham Zakaryan <zakaryan.2004@outlook.com>
2021-10-01 23:25:35 +02:00
Balázs Orbán
72d4c5bfe1 feat(providers): refactor Azure B2C provider (#2862)
* fix(providers): refactor AzureB2C provider

* chore(dev): add Azure B2C to the dev app

* chore(providers): remove unnecessary config
2021-09-29 23:43:42 +02:00
Kiran Jd
f6350354f0 fix(provider): refactor Okta provider (#2856)
* fix(provider): refactor Okta provider

* fix(providers): convert Okta to TS

* fix: typo

* fix(okta): adds picture to profile

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

* fix(provider): refactor Okta provider

fix(providers): convert Okta to TS

fix: typo

* fix: resolves merge conflicts

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-09-28 20:59:57 +02:00
Balázs Orbán
50e6a64832 feat(providers): expose openid-client options client and jwks (#2717) 2021-09-28 17:32:47 +02:00
Balázs Orbán
9e1eab088a fix(providers): convert to TS, add picture (#2851) 2021-09-28 14:47:33 +02:00
Balázs Orbán
f0551b07b8 feat(providers): refactor Slack provider (#2848)
* chore(dev): add SlackProvider to dev app

* feat(providers): refactor Slack provider

* chore(dev): remove unwanted provider
2021-09-28 14:47:18 +02:00
Balázs Orbán
c2fd58d72a chore: remove unused www reference 2021-09-28 01:53:09 +02:00
Balázs Orbán
b052d4cfc1 fix(providers): make string endpoint handlers overrideable (#2842)
* chore: remove `console.log`

* chore(ts): improve `InternalProvider` type

* refactor(ts): convert some files to TypeScript

* fix(providers): make string endpoint handlers overrideable
2021-09-26 22:02:21 +02:00
Balázs Orbán
506672676a feat(providers): refactor Cognito provider (#2829)
* chore(dev): add CognitoProvider to dev app

* feat(log): log `error_description` in OAuth callback

* fix(providers): migrate Cognito to v4

* docs: mention superblog.ai for infra support

* fix: return profile picture for Cognito

* fix(ts): add picture to CognitoProfile
2021-09-25 14:14:56 +02:00
Nico Domino
ffa2b1bd6b fix: use default export map syntax for ESM/CJS (#2830) 2021-09-25 14:01:28 +02:00
Balázs Orbán
1d52600f41 fix(provider): refactor LinkedIn provider (#2821) 2021-09-24 11:27:57 +02:00
Balázs Orbán
9693277222 chore(app): add SpotifyProvider to dev app 2021-09-23 00:43:28 +02:00
Balázs Orbán
19a33f3131 chore(dev): add AzureADProvider to dev app 2021-09-22 23:55:49 +02:00
Nico Domino
424bd04eff fix(providers): refactor Azure AD provider to support v4 (#2818) 2021-09-22 23:35:13 +02:00
ndom91
a177bbb68c fix: login logo height 2021-09-22 22:21:45 +02:00
Jussi Räsänen
04fc3fd6bc fix(provider): remove extra brace from jwks_uri (#2813) 2021-09-22 16:17:43 +02:00
Nico Domino
cabcdc967f feat: built-in page theme updates (#2788)
Add some very minimal customization to the built-in pages so people might not immediately need to replace them. This way they can customize some things with their brand color and add their company/project logo. We explicitly **do not** want to go overboard styling this page. This is not an authentication component library or Next.js app template!

Example:
```js
export default NextAuth({
  providers: [...],
  jwt: {...},
  theme: {
    colorScheme: 'auto',
    brandColor: '#67b246',
    logo: 'https://company.com/assets/logo.png'
  }
})
```
2021-09-20 00:48:36 +02:00
Balázs Orbán
a2c4046772 fix(ts): add defaults to OAuthConfig generics 2021-09-15 10:24:26 +02:00
Balázs Orbán
ea3f0d6911 refactor(ts): move Twitch to TypeScript 2021-09-15 10:19:35 +02:00
Mathis Møller
819e97e6d2 fix: respect id from user options in signinUrl and callbackUrl id (#2698) 2021-09-08 20:31:24 +02:00
Patryk Slowinski
17bea4ab69 fix(ts): hint built-in provider types in signIn (#2655)
* Change singIn provider type to optional string

* provider intellisense support

* restore clean

* Requested changes

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-09-07 10:56:55 +02:00
Balázs Orbán
0989accf23 fix(ts): make OAuth profile overrideable (#2682)
* fix(ts): make OAuth profile overrideable

* fix(ts): default to empty object

* fix(ts): use relative import
2021-09-06 23:42:03 +02:00
Balázs Orbán
3b23cfe3a5 fix(ts): forward credentials fields to authorize (#2683) 2021-09-06 23:41:30 +02:00
Balázs Orbán
419ffe7787 fix(ts): make options on useSession optional
Fixes #2674
2021-09-06 10:58:09 +02:00
Balázs Orbán
2cb763ceba chore: remove test:types script in release workflow 2021-09-05 11:14:04 +02:00
Balázs Orbán
8bfbaa41a9 chore: fix build due to Next.js type error
See: https://github.com/vercel/next.js/pull/28672
2021-09-05 11:11:29 +02:00
Balázs Orbán
7dfc5811b0 chore: remove docs after merge 2021-09-04 12:28:50 +02:00
Balázs Orbán
3f943d2f8a Merge beta into next 2021-09-04 12:28:19 +02:00
Balázs Orbán
da8d729129 Merge main into next 2021-09-04 12:23:22 +02:00
Balázs Orbán
245567bb98 fix: avoid infinite loop in error handlers (#2647)
* fix: avoid infinite loop in error handlers

* chore(dev): remove mongodb folder
2021-09-03 01:25:56 +02:00
Balázs Orbán
8f32b5d625 refactor(dev): use Next.js externalDir to fix dev app (#2631) 2021-09-01 21:06:36 +02:00
Balázs Orbán
e099223a27 refactor(ts): rewrite core to TypeScript (#2552)
* chore(deps): upgrade TS packages

* build(ts): use tsc to compile

* refactor(ts): move some files to TS

* chore: implement SkyPack check suggestions

* chore(ci): temprarily disable tests

* chore: add PR comment action

* chore: add determine version github action

* chore: prefix with env.

* chore: add runs to action

* chore: change runs.using to node12

* chore: fix typo

* chore: install @actions/core as dev dependency

* chore: move env var, remove old script

* chore: change version comment message

* refactor(ts): convert server/index.js to TS

* chore: fix `types` path

* chore: fix paths

* refactor(ts): convert `next-auth/react`

* refactor(ts): convert `next-auth/jwt` to TS

* chore: fix import

* refactor: move `types` into `src`

* refactor(ts): fix types imports

* chore: add cleanup script

* chore: exclude all `tests` folder from compilation

* refactor: rename types/index.d.ts to types/index.ts

* refactor(ts): move `next-auth/jwt`

* refactor(ts): move `next-auth/providers`

* chore(ts): fix `next-auth` types

* refactor(ts): change internal import paths

* test(ts): remove type tests

* chore: remove test:types script

* refactor(ts): move more code to TypeScript

* refactor: fix some imports

* refactor(ts): move error module into server

* fix(ts): add type to .js providers

* chore: rename adapters.ts to adapters.d.ts

* fix: update exports field

* chore: add files that should end up on npm

* chore: add stricter lib checking

* refactor(ts): remove unnecessary files, fix imports

* chore: autocomplete env variables

* fix: add css folder to npm files

* fix: fix CSS import/generation

* feat: log provider when authorization url error happens

* refactor(ts): turn pages into .tsx

* chore: compile differently for client/server

* refactor(ts): move server file to TS

* chore: add back node target

* chore: add back comment removal

* chore: re-enable tests

* chore: ignore test files when building

* chore(ts): refactor files to TS

* chore(ts): fix imports

* chore(ts): more ts

* fix(ts): correctly type _NEXTAUTH_DEBUG env var

* chore: don't generate internals module iwth babel

* fix(ts): better `clientId`, `clientSecret` constraints

* refactor(ts): move facebook provider to TS

* refactor(ts): apply suggested changes

* chore(ts): strip internal types from compilation

* refactor(ts): move server types to server folder

* refactor(ts): rename internals to types
2021-08-31 15:18:12 +02:00
Gianluca
e8a58a01b6 docs(contributing): fixed numeration type (#2624)
There was a numeration type error in the "For  contributors" section
2021-08-29 11:30:05 +02:00
Lluis Agusti
08349c3a8b feat(client): remove staleTime (#2613)
BREAKING CHANGE:

`staleTime` (previously `clientMaxAge`) has been removed. Check out `refetchInterval` instead. It should cover most of the cases. If not, we can look into adding this back later on.
2021-08-27 21:44:10 +02:00
Balázs Orbán
1c1e8410e6 chore(docs): remove docs from repo (#2609)
Documentation has been moved to its own repository. See https://github.com/nextauthjs/docs
2021-08-27 13:15:33 +02:00
Balázs Orbán
a49903fd76 Merge main into next 2021-08-27 00:48:11 +02:00
Nico Domino
55ab95e3be docs(providers): split provider type docs into individual pages (#2480)
* docs(providers): split provider type docs into individual pages

* fix: spelling

* docs: wrap interface

* fix: oauth provider config copy
2021-08-27 00:25:00 +02:00
Nico Domino
5da62888ce docs: add v4 migration docs page (#2350)
* docs: add initial migration to v4 docs page

* docs: add upgrade guide to sidebar

* docs: number migration sections

* docs: add more breaking changes and link to releases

* docs: cleanup text

* docs(dep): bump docusaurus to latest beta

* docs(www): upgrade guide

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(www): upgrade guide

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(www): upgrade guide

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(www): upgrade guide

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(www): add nodemailer link

* docs(www): add v4-next.20 breaking change notes

* docs(www): typo

* Update www/docs/getting-started/upgrade-to-v4.md

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

* Update www/docs/getting-started/upgrade-to-v4.md

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

* docs(www): move provider rename hint

* docs(www): add OAuth provider import changes

* docs(www): add adapter notes

* fix: update schema image

* docs(typeorm): add new postgres schema

* docs(typeorm): add new mysql schema

* docs(typeorm): fix mysql timestamp fields

* docs(www): update provider copy

* docs(www): add note regarding github provider scope

* docs: add suggestions to migration docs

* docs: add note about adapter api rewrite

* docs: fix upgrade headings

* docs: upgrade docs copy

* docs: upgrade link

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-08-27 00:01:50 +02:00
Nico Domino
91de463a5e docs(providers): add tip about async provider code (#2443) 2021-08-26 23:45:07 +02:00
Nico Domino
4a9d871698 docs(www): add more algolia no-result terms (#2442) 2021-08-26 23:41:49 +02:00
Alex Vilchis
c2119b15de chore(docs): fix dependency name (#2607) 2021-08-26 19:42:20 +02:00
Lluis Agusti
d76f15b6fa test(client): fully cover client module (#2295)
Contains:

* test(client-provider): fix flaky test
* wip
* test(client-provider): verify more use-cases
* test(client): programmatic session refetch
* test(client): further coverage
* test(client): `stateTime` + `refetchInterval`
* refactor(client): test insights
* refactor: unused variable
* chore: revert `package-lock.json` to  v2
* refactor: pair-review suggestions
2021-08-26 15:30:58 +02:00
Alex Vilchis
0ce15c4a18 docs: Fix grammar (#2602) 2021-08-25 19:48:14 +02:00
Bruno Bigras
eb8ba69d3b feat(provider): add Keycloak provider (#2485)
* add Keycloak provider

* Update src/providers/keycloak.js

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-08-23 22:43:05 +02:00
dan-kwiat
a9f699fd54 fix(callback): respect callbackUrl in Email Provider (#2574)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-08-23 22:10:33 +02:00
Nico Domino
ead715219a fix(deps): update built-in adapter dependencies (#2589)
* fix(deps): update prisma-legacy-adapter and typeorm-legacy-adapter dependencies

* chore: add missing package-lock update
2021-08-23 21:55:33 +02:00
nathanclevenger
e15bf9b2f5 feat(provider): use more restrictive default scope for GitHub (#2579)
When using the default settings of the Github provider, with the "user" scope, it grants read/write access to profile info only. By changing to "read:user" and "user:email" it will only request read-only access https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-apps

BREAKING CHANGE:

By default, the GitHub Provider scope won't ask for full write access to user profiles. If you need that, you will now have to add the `user` scope to your configuration.
2021-08-22 01:29:48 +02:00
Ashutosh Kumar
8faa7553dd docs: add suggestions for secret and encryption key generation (#2578) 2021-08-21 23:08:56 +02:00
Eduard Babinyan
90a6a0084b feat(provider): return image for Yandex by default (#2563)
Uploading an user image.
2021-08-20 09:37:30 +02:00
Aaron Powell
cb844a2436 docs(provider): remove en-us from Azure urls (#2554)
MS Docs has a lot of local language translations, so it's best to remove locale information from the URLs so that when someone follows them, they land on the right language version of the content.
2021-08-18 09:46:32 +02:00
Balázs Orbán
e06ced5b66 chore: add FaunaAdapter to dev app 2021-08-17 23:51:53 +02:00
Balázs Orbán
2c43fbd867 fix(provider): remove double CSS from email template 2021-08-17 12:24:08 +02:00
Sercan Altundas
74558d6cc2 docs(email): remove duplicate CSS property from html (#2546)
- The CSS property 'text-decoration: none;' was duplicated in the example html code and is removed.
2021-08-17 12:17:54 +02:00
Jaye Hackett
d03125a77b docs(ts): mention module augmentation on callbacks (#2541) 2021-08-17 01:01:19 +02:00
Balázs Orbán
78d8f28968 fix(ts): allow void return type on delete operations 2021-08-16 11:50:43 +02:00
Balázs Orbán
8914f88cd7 feat: simplify Adapter API (#2361)
BREAKING CHANGE:

`prisma-legacy` is now gone. Use `@next-auth/prisma-adapter`. Any features from the old adapter will be migrated over to the new one eventually. This is done so we can require the same default set of options from all the built-in providers, rather than allowing ambiguity on what an official adapter has to support.

The `TypeORM` adapter will probably be the only one migrated as-is, but in the future, we would like to break it down to lighter-weight adapters that only support single databases.

Adapters no longer have to return a `getAdapter()` method, they can return the actual adapter methods instead. All the values previously being provided through the arguments of `getAdapter` will now be available in a more digestible format directly in the concerning methods. This behavior was created so that connections could be handled more efficiently. Our review has shown that currently, the TypeORM adapter is the only one that does not handle connections out-of-the-box, so we are going to look into how we can create a wrapper/util function to make it work in the new version. For all other adapters, this will be a huge gain, as with this new API, methods are actually overrideable without creating a whole new custom adapter! 🥳

Example:

```js
function MySlightlyCustomAdapter(...args) {
  const adapter = AdapterFromSomeoneElse(...args)
  adapter.someMethodIWantToModify = (...args) => {
    // Much better implementation goes here.
  }
  return adapter
}
```

**The following method names are changing:**

```diff
- getSession
+ getSessionAndUser
```
This method now requires that you return both the user and the session as `{user, session}`. If any of these could not be retrieved, you will have to return `null` instead. (In other words, this must be a transaction.) This requires one less database call, improving the user session retrieval. Any expiry logic included in the Adapter before is now done in the core as well.

```diff
- createVerificationRequest
+ createVerificationToken
```
Better describes the functionality. This method no longer needs to call `provider.sendVerificationRequest`, we are moving this into the core. This responsibility shouldn't have fallen to the adapter in the first place.

`createVerificationToken` will now receive a `VerificationToken` object, which looks like this:
```ts
interface VerificationToken {
  identifier: string
  expires: Date
  token: string
}
```

The token provided is already hashed, so nothing has to be done, simply write it to your database. (Here we lift up the responsibility from the adapter to hash tokens)


```diff
- getVerificationRequest
+ useVerificationToken
```
Better describes the functionality. It now also has the responsibility to delete the used-up token from the database. Most ORMs should support retrieving the value while deleting it at the same time, so it will reduce the number of database calls.

``` diff
- deleteVerificationRequest
```
This method is gone. See `useVerificationToken`.

Most of the method signatures have been changed, have a look at the [TypeScript interface](ba4ec5faa3/types/adapters.d.ts) to get a better picture.
2021-08-15 21:01:56 +02:00
Balázs Orbán
55132e5da2 feat(provider): require to import every provider individually (#2518)
Adds a new way to import providers for modularity and better tree-shaking.

BREAKING CHANGE:

Providers now have to be imported one-by-one:

Example:
```diff
- import Provider from "next-auth/providers"
- Providers.Auth0({...})
+ import Auth0Provider from "next-auth/providers/auth0"
+ Auth0Provider({...})
```
2021-08-13 19:12:52 +02:00
Balázs Orbán
65040dcc83 fix(provider): make userinfo.params optional (#2517) 2021-08-13 18:38:24 +02:00
Liam Tait
66d16f8bf4 fix(ts): allow scope as string array type (#2511) 2021-08-12 17:51:31 +02:00
Griko Nibras
92b9d22309 fix(ts): fix internal react type import (#2450)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-08-12 13:06:58 +02:00
Balázs Orbán
b50a2eb845 refactor: remove wrapping Promise (#2514)
* refactor: don't wrap NextAuth handler with Promise

* refactor: update OneLogin provider config

* chore: add OneLogin to dev app

* chore: fix typo
2021-08-11 14:05:21 +02:00
Balázs Orbán
e5fe470792 Merge main into next 2021-08-05 01:27:44 +02:00
Balázs Orbán
7c65bda6f1 feat: improve OAuth provider configuration (#2411)
> This touches on all OAuth providers, so there is a big potential for breaking by default. We have let new providers be added for contributors' specific needs, but from now on, we will require a more strict default on all new providers, so the basic behavior is predictable for everyone.
⚠ Unfortunately, we will not have the capacity to test each and every provider that has been added to the default providers, but we will do our best to test the most popular ones. (@ndom91 has worked on setting up the infrastructure for this). If you wish to make sure that the provider you are using will stay working, please reach out with your concerns and tell us how can you help us test that particular provider in the future. 🙏

That said, I will try my best to not break ANY of the currently built-in providers, or at least make the migration super easy. So hopefully, you won't have to change anything. It will most probably affect you if you defined a custom provider though.

We will monitor the default configuration much more closely, so the behavior will be more consistent across providers by default.

Closes #1846, Closes #1605, Closes #1607

BREAKING CHANGES:

Basecamp provider is removed. See the explanation [here](https://github.com/basecamp/api/blob/master/sections/authentication.md#on-authenticating-users-via-oauth)

**ALL** OAuth providers' `profile` callback is expected to only return these fields by default from now on: `id`, `name`, `email`, and `image` at most. Any of these missing values should be set to `null`.

The following new options are available:
1. `authorization` (replaces `authorizationUrl`, `authorizationParams`, `scope`)
2. `token` replaces (`accessTokenUrl`, `headers`, `params`)
3. `userinfo` (replaces `profileUrl`)

These three options map nicely to the OAuth spec's three endpoints for
1. initiating the login flow
2. retrieve OAuth tokens
3. retrieve user information

They all take the form of `EndpointHandler`:
```ts
type EndpointRequest<C, R> = (
  context: C & {
    /** `openid-client` Client */
    client: Client
    /** Provider is passed for convenience, ans also contains the `callbackUrl`. */
    provider: OAuthConfig & {
      signinUrl: string
      callbackUrl: string
    }
  }
) => Awaitable<R>

/** Gives granular control of the request to the given endpoint */
type AdvancedEndpointHandler<P extends UrlParams, C, R> = {
  /** Endpoint URL. Can contain parameters. Optionally, you can use `params`*/
  url?: string
  /** These will be prepended to the `url` */
  params?: P
  /**
   * Control the corresponding OAuth endpoint request completely.
   * Useful if your provider relies on some custom behavior
   * or it diverges from the OAuth spec.
   *
   * - ⚠ **This is an advanced option.**
   * You should **try to avoid using advanced options** unless you are very comfortable using them.
   */
  request?: EndpointRequest<C, R>
}

/** Either an URL (containing all the parameters) or an object with more granular control. */
type EndpointHandler<P extends UrlParams, C = any, R = any> =
  | string
  | AdvancedEndpointHandler<P, C, R>
```

In case of `authorization`, the `EndpointHandler` can define the `params` as [`AuthorizationParameters`](51dc47d9ac/types/index.d.ts (L108-L143))

> Note: `authorization` does not implement `request` yet. We will have to see if there is demand for it.

From now on, instead of using the `...` spread operator when adding a new built-in provider, the user is expected to add `options` as a property at the end of the default config. This way, we can deep merge the user config with the default one. This is needed  to let the user do something like this:

```js
MyProvider({
  clientId: "",
  clientSecret: "",
  authorization: { params: {scope: ""} }
})
```
So even if the default config defines anything in `authorization`, only the user-defined parts will be overridden.
2021-08-05 00:42:47 +02:00
Nico Domino
be74dd0e7e docs(security): email contact update (#2467)
* chore(docs): email contact update

* chore(docs): add me@iaincollins.com back
2021-08-02 17:18:17 +02:00
Aryan Beezadhur
9bf867ddcf docs: Update faq.md (#2458) 2021-07-30 22:34:32 +02:00
Nico Domino
0f460c22da docs(client): add text regarding 'logout' (#2432) 2021-07-28 20:10:08 +02:00
Sigurd Heggemsnes
887cb00877 docs(adapter): Typo in filepath for firebase auth in docs. (#2436) 2021-07-28 12:48:47 +02:00
Balázs Orbán
f06e4d286b refactor: replace node-oauth with openid-client (#1698)
* chore(deps): add openid-client

* chore: merge in next

* refactor(provider): remove redundant requestUrl param

* feat(provider): make profile callback optional

* refactor: use openid-client for OAuth2/OIDC

* refactor: use openidClient in oauth signin handler

* refactor: use openidClient in oauth callback handler

* docs(warn): add async issuer/old config warnings

* chore(deps): remove jsonwebtoken

* chore: add issuer property for testing locally

* chore(dev): import providers one-by-one

* fix(oauth): handle when no user in body/query

* chore(deps): remove pkce-challenge

* chore(dev): change Auth0 protection

* refactor(oauth): simplify pkce/state

* refactor: split OAuth1 client, reduce openid client

will improve API in another PR

* chore: change comment, dev app

* chore: mention OIDC client config discovery

* fix: add new operator when creating OIDC client

* refactor: delete req.query.nextauth after use

* docs(ts): use `TokenSet` from `openid-client`

* chore: simplify/type signin route

* refactor: rename to client-legacy to indicate intnet of maintenance

* chore(deps): try setting `oauth` as optional peer dep

* chore(deps): add `oauth` back as regular dependency

* chore(deps): add @types/oauth as dev dependency

* chore: remove params kept for backwards compatibility

* chore: don't make breaking changes in this PR

* chore(core): use correct TS declarations

* refactor: move files/add more accurate types internally

* chore: remove TODO comment

* chore: catch all errors in authorization URL generation
2021-07-20 14:52:35 +02:00
Douglas
75ca097ff7 docs: Fix link to code (#2405) 2021-07-19 15:36:37 +02:00
Nicolas Azari
bcb9383aec docs: fix typos in options.md (#2393)
* Update options.md

* Update www/docs/configuration/options.md

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-07-17 22:21:45 +02:00
Lluis Agusti
bececbc200 Revert "refactor(providers): try Typescript"
This reverts commit 6d74da1f65.
2021-07-17 21:58:25 +02:00
Lluis Agusti
6d74da1f65 refactor(providers): try Typescript 2021-07-17 21:56:18 +02:00
John Michael Kuhn Jr
b953963101 chore(core): fix typo in csrf-token-handler.js where 'strategy' is misspelled (#2391) 2021-07-17 12:02:38 +02:00
Nico Domino
4649f1968b docs(readme): add opencollective details to readme (#2388)
* docs(readme): add opencollective details to readme

* docs(www): add sponsors to docs footer

* docs(readme): move support under ack

* docs(www): dropped docusaurus link in footer
2021-07-16 18:05:15 +02:00
Angelo Annunziata
45f4a69a4e docs(configuration): remove comments in JWT example (#2378) 2021-07-16 09:28:19 +02:00
Prabhdeep Singh
2155c93a3c feat(providers): add OneLogin (#2345)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-07-14 11:07:56 +02:00
Angelo Annunziata
d5958571a4 docs(provider): fix typo (#2369) 2021-07-13 21:36:00 +02:00
Theo Browne
3312e53279 feat(events): include profile on signIn events (#2356)
* include profile on signIn events

* update docs

* Undefined profile on credentials, update docs
2021-07-13 18:12:24 +02:00
James Q Quick
ebecaa6a4b docs(adapter): match Fauna index name with implementation(#2360)
* Update Fauna Adapter 

- added one-liner to explain how to use the setup scripts inside of the Fauna dashboard
- updated the `verification_request_by_token` index name to match what is expected inside of the SDK which is `verification_request_by_token_and_identifier`

* Update Typo

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-07-13 17:58:58 +02:00
Vincent Grafé
1c5173a818 docs(callbacks): fix typo (#2363) 2021-07-13 10:24:05 +02:00
Nico Domino
ebf420c84a docs: clarify page protection (#2355) 2021-07-12 01:28:39 +02:00
Balázs Orbán
111d5fc572 feat(events): use named params for all event callbacks (#2342)
Unified API for all of our user-facing methods.

NOTE: `events.error` has been removed. This method has never been called in the core, so it did actually nothing. If you want to log errors to a third-party, check out the [`logger`](https://next-auth.js.org/configuration/options#logger) option instead.

BREAKING CHANGE:

Two event signatures changed to use named params, `signOut` and `updateUser`:
```diff
// [...nextauth].js
...
events: {
- signOut(tokenOrSession),
+ signOut({ token, session }), // token if using JWT, session if DB persisted sessions.
- updateUser(user)
+ updateUser({ user })
}
```
2021-07-12 00:30:24 +02:00
Balázs Orbán
acc9393560 feat(logger): simplify logger API (#2344)
Similar to #2342, this aims to unify the user-facing API and provide an easier way to extend in the future.

In addition, this PR also solves the problem when the `logger.error` method sometimes did not print results, because `Error` instances are not serializable and will be printed as empty objects `"{}"`.

After this PR, we make any `Error` instances serializable as described here: https://iaincollins.medium.com/error-handling-in-javascript-a6172ccdf9af

Closes #1602
Achieved by adding a `client: true` flag when logs are coming from the frontend.

BREAKING CHANGE:

The main change is that instead of an unknown number of parameters, the log events have at most two, where the second parameter is usually an object. In the case of the `error` event, it can also be an `Error` instance (that is serializable by `JSON.stringify`). If it is an object, an `Error` instance will be available on `metadata.error`, and `message` will default to `metadata.error.message`. This is done so that an error event always provides some kind of a stack to see where the error happened

```diff
// [...nextauth.js]
import log from "some-logger-service"
...
logger: {
- error(code, ...message) {},
+ error(code, metadata) {},
- warn(code, ...message) {},
+ warn(code) {}
- debug(code, ...message) {}
+ debug(code, metadata) {}
}
```
2021-07-12 00:17:32 +02:00
Ben Goshow
35ce332cc6 feat(providers): add Freshbooks (#2322)
Contains the following squashed commits: 

* Create freshbooks.js
* Create freshbooks.md
* Update providers.d.ts
* Update freshbooks.md
* Update src/providers/freshbooks.js
* Update providers.test.ts
* Update freshbooks.md
2021-07-11 20:25:26 +02:00
Imamuzzaki Abu Salam
ec295287f1 docs: delete can word in "can can" (#2348) 2021-07-11 15:08:05 +02:00
Balázs Orbán
6911dd9267 feat: rename protection to checks (#2255)
This change aligns the API with `openid-client`'s `checks` https://github.com/panva/node-openid-client/blob/main/docs/README.md#clientcallbackredirecturi-parameters-checks-extras, a library which we intend to migrate to in the future. Aligning our API early, so people get used to it.

Also, objectively the name `protection` might not have been as clear as I first thought. `checks` better describe the intention.

BREAKING CHANGE:

The `state` option on OAuth providers is now deprecated. Use `checks: ["state"]` instead.
`protections` is renamed to `checks`, here is an example:
```diff
- protection: ["pkce"]
+ checks: ["pkece"]
```

Furthermore, string values are not supported anymore. This is to be able to handle fewer cases internally.
```diff
- checks: "state"
+ checks: ["state"]
```
2021-07-10 23:55:20 +02:00
Balázs Orbán
cff153bd80 Merge main into next 2021-07-10 12:02:21 +02:00
Nick Arciero
46978ac02f docs(tutorial): Add link to blog post about integrating with Magic (#2340) 2021-07-10 09:56:13 +02:00
Pol
f546e550dd fix(oauth): correctly remove code_verifier cookie when used (#2325)
Co-authored-by: Pol Bonastre <pbonastre@plainconcepts.com>
2021-07-08 17:24:56 +02:00
Balázs Orbán
ac5b4db0f2 chore: add OpenCollective link to FUNDING.yml 2021-07-05 17:54:34 +02:00
Balázs Orbán
a2e5afa162 feat(react): make session requireable in useSession (#2236)
A living session could be a requirement for specific pages (like dashboards). If it doesn’t exist, the user should be redirected to a page asking them to sign in again.

Sometimes, a user might log out by accident, or by deleting cookies on purpose. If that happens (e.g. on a separate tab), then `useSession({ required: true })` should detect the absence of a session cookie and always return a non-nullable Session object type.

When `required: true` is set, the default behavior will be to redirect the user to the sign-in page. This can be overridden by an `action()` callback:

```js
const session = useSession({
  required: true,
  action() {
    // ....
  }
})
if (session.status === "Loading") return "Loading or not authenticated..."

// session.data is always defined here.
```

Co-authored-by: Kristóf Poduszló <kripod@protonmail.com>
Co-authored-by: Lluis Agusti <hi@llu.lu>

BREAKING CHANGE:

The `useSession` hook now returns an object. Here is how to accommodate for this change:

```diff
- const [ session, loading ] = useSession()
+ const { data: session, status } = useSession()
+ const loading = status === "loading"
```

With the new `status` option, you can test states much more clearly.
2021-07-05 16:03:55 +02:00
Nico Domino
53e5e37948 docs: update tutorials/faq structure (#2256)
* docs: cleanup css

* docs: upgrade deps

* docs: cleanup docusaurus config

* docs: reorganise tutorials page

* docs: fix github-counter css

* docs: update faq page structure

* docs(tutorials): copy

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(tutorials): copy

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(tutorials): copy

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(tutorials): copy

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(style): reorg css

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-07-05 11:15:45 +02:00
Mahieyin Rahmun
8bbffdd08c docs(github): remove title property (#2308) 2021-07-04 13:23:44 +02:00
Mahieyin Rahmun
a22a0a36fd docs(github): remove title prefix and make reproductions required (#2306) 2021-07-04 11:19:13 +02:00
Mahieyin Rahmun
797272afe1 docs: use issue template forms (#2274)
* (docs) initial issue template forms as per #2271

* (typo) fix grammar and typo

* (forms) make the requested changes

* (chore) delete the old .md files

* (forms) fix type key
2021-07-02 21:13:03 +02:00
Balázs Orbán
8ff4b26014 Merge main into next 2021-07-02 13:10:34 +02:00
Mahieyin Rahmun
13e56bcf2f docs(adapters): update outdated documentation (#2296) 2021-07-02 12:50:27 +02:00
yokinist
b0f7f87c04 docs: update 'pages' option in example code (#2270) 2021-07-01 17:12:01 +02:00
Balázs Orbán
9c0851c0f9 chore(ci): shorten names in release.yml workflow 2021-06-30 21:36:28 +02:00
Andriy Komm
f5b3c29ab1 fix(ts): improve authorize typing on Credentials provider (#2227)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-30 15:49:38 +02:00
Nico Domino
b4f2a0106a chore(ci): add environment approval (#2214)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-30 15:28:12 +02:00
Balázs Orbán
2c35aa27f9 Merge main into next 2021-06-29 22:55:33 +02:00
Balázs Orbán
9c095b0532 chore(dev): fix dev app when running locally (#2280)
* fix: fix console warning in dev app

* chore: add `npm i` to `dev:setup` script

* chore(deps): update dev dependencies (react+next)

* chore: update package-lock.json

* chore: use node 16 in actions
2021-06-29 22:11:55 +02:00
Nico Domino
0475964a0f chore(pages): typo in error messages (#2265) 2021-06-28 02:57:35 +02:00
Justin Forlenza
ad6c13cdc9 fix(ts): extend server type in Email provider from nodemailer (#2259)
* Added optional secure & TLS settings for SMTP

* Replaced custom interface with nodemailers

* Fix lockfile version

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-27 18:51:34 +02:00
Nico Domino
591aa7cc7e docs(adapter): rm @canary from adapters' install instructions (#2260) 2021-06-27 18:28:58 +02:00
ndom91
9abb392b4e chore: fix gh action typo 2021-06-27 03:39:38 +02:00
ndom91
b89ae87fb1 docs: respect color mode 2021-06-27 03:38:04 +02:00
ndom91
3687d17724 Merge branch 'main' of ssh://github.com/nextauthjs/next-auth 2021-06-27 03:11:07 +02:00
Balázs Orbán
2833b661bd feat(core): use named params in callbacks (#2173)
Some of our user-facing callbacks come with a bunch of parameters, and it is not always the case that a user needs all of them. Picking out certain parameters from the end of the list would require the user to define params that they wouldn't even need.

Therefore this PR changes such callbacks so the user can only pick the necessary parameters.

This comes with the bonus of better TS support on the `session` and `signIn` callbacks, where some parameters historically could have been different types.

In the `session` callback, the second param could have been `token` (when using JWT sessions) or `user` (when using DB persisted sessions). Now they are separate parameters.

In the `signIn` callback, we now separate `profile` (OAuth), `email` (Email) and `credentials` (Credentials) provider params.

BREAKING CHANGE:

The `callbacks` method signatures are changing the following way:

```diff
- signIn(user, account, profileOrEmailOrCredentials)
+ signIn({ user, account, profile, email, credentials })
```
```diff
- redirect(url, baseUrl)
+ redirect({ url, baseUrl })
```
```diff
- session(session, tokenOrUser)
+ session({ session, token, user })
```
```diff
- jwt(token, user, account, OAuthProfile, isNewUser)
+ jwt({ token, user, account, profile, isNewUser })
```

> NOTE: You only need to define the params that you actually need (no more need  for `_` params.)

This way, if you only need `token` and `account` in the `jwt` callback, you can write:

```js
jwt({ token, account }) {
  if(account) {
    token.accessToken = account.access_token
  }
  return token
}
```
2021-06-26 14:54:13 +02:00
Balázs Orbán
6c1a0ec620 feat: bump dependencies (#2254)
Node 10 has reached end-of-life, Next.js stopped supporting it in Next 11. Since we are a Next.js library, it doesn't make sense for us to support anything lower than that either.

I also upgraded a bunch of dependencies and dropped some that weren't necessary anymore.

BREAKING CHANGE:

The lowest supported Node version is 12. (We still support IE11 in browsers, until that is not dropped by Next.js itself)
2021-06-26 11:39:18 +02:00
Balázs Orbán
988c9912b1 test(ts): fix ts tests 2021-06-26 00:32:35 +02:00
Balázs Orbán
a225324d4f Merge main into next 2021-06-25 22:10:09 +02:00
Balázs Orbán
b04ff82fb9 chore: clarify where to run envinfo in bug report template 2021-06-24 01:46:02 +02:00
Balázs Orbán
c11915ba9c chore: update bug report template 2021-06-24 01:44:33 +02:00
Balázs Orbán
24ee459f97 chore(ci): run tests and typechecks only 2021-06-24 00:38:17 +02:00
Balázs Orbán
ac4851d238 chore(ci): run test:ci (linting+test+typecheck) 2021-06-24 00:33:32 +02:00
Nico Domino
3a48b8e467 docs: update errors page with more details (#2196) 2021-06-22 20:15:17 +02:00
can-mihci
84094b0ee7 docs(client): fix code block typo (#2217) 2021-06-22 20:11:18 +02:00
Vikrant Bhat
f09ab4a04f docs(providers): fix typo (#2220) 2021-06-22 20:08:43 +02:00
Vikrant Bhat
067364381b docs(providers): fix english sentence in Email provider section (#2222) 2021-06-22 09:28:47 +02:00
Lluis Agusti
fb50b54466 test(client-provider): fix flaky test (#2216) 2021-06-20 20:04:34 +02:00
ndom91
6ee36b6842 ci: test release environment approval 2021-06-18 20:03:07 +02:00
Sheldon Vaughn
fa89431573 docs(provider): import useState in WorkOS example (#2198)
Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Add useState dependency

I went to execute the signin.js file and received an error that useState was undefined. Was able to reconcile this by adding the dependency.

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Sangwon Park <dev.psw@gmail.com>
2021-06-17 01:23:50 +02:00
Balázs Orbán
3383857715 Merge branch 'main' into next 2021-06-17 01:21:49 +02:00
David Peherstorfer
bbc2d9b538 docs(provider): scope expects space separated string (#2188)
* fix(docs): scope expects space separated string

Currently the docs list string[] as possible type for scope. 
However, It only accepts a string (with space as separator).

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-16 07:38:39 +02:00
Sangwon Park
5a89ab69d3 feat(provider): add Naver provider (#2172)
* add Naver provider

* fix typo

* Update src/providers/naver.js

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-16 00:46:41 +02:00
Hugh Boylan
d10bd9beba fix(react): publish react scripts with npm build (#2192) 2021-06-15 23:27:06 +02:00
Vikrant Bhat
c1c866f664 docs(provider): English language sentence fix (#2175)
* English language sentence fix

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-14 23:55:10 +02:00
Balázs Orbán
86ff89e296 fix(react): initialize session without loading state (#2180)
See commit dd12181378
2021-06-14 21:16:42 +02:00
Hugh Boylan
dd12181378 initialize session without loading state (#2180) 2021-06-14 20:11:56 +02:00
Balázs Orbán
47c17a89ae Merge branch 'main' into next
commit 665445818e
Author: Balázs Orbán <info@balazsorban.com>
Date:   Sat Jun 12 17:11:53 2021 +0200

    docs(config): link to next documentation instead of canary

commit 67cf2a11bb
Author: ndom91 <yo@ndo.dev>
Date:   Sat Jun 12 16:42:48 2021 +0200

    docs: fix alt client provider example
2021-06-12 17:15:35 +02:00
Balázs Orbán
665445818e docs(config): link to next documentation instead of canary 2021-06-12 17:11:53 +02:00
Nico Domino
c07fe1b9a7 docs: add versioned docs for unreleased v4.0.0-next.* (#2167)
* docs: add versioned docs for unreleased canary 4.x

* docs(fix): prettier broke custom image component without .mdx extension

* docs(feat): automatically fetch latest stable version label

* docs: cleanup script

* docs: cleanup next version name

* docs(chore): cleanup version leftovers

* docs: fix .gitignore

* docs: v4 default

* docs: remove auto version generation

* docs: fix missing import

* docs: rm node-fetch
2021-06-12 17:04:32 +02:00
ndom91
67cf2a11bb docs: fix alt client provider example 2021-06-12 16:42:48 +02:00
Balázs Orbán
abaa5aed65 fix(react): don't use localStorage on server side (#2166) 2021-06-11 22:11:50 +02:00
Balázs Orbán
ca0ed1e2a8 feat(react): create client tailored to React (#1473)
**What**:

These changes ensure that we work more tightly with React that can also result in unforeseen performance boosts. In case we would decide on expanding to other libraries/frameworks, a new file per framework could be added.

**Why**:

Some performance issues (https://github.com/nextauthjs/next-auth/issues/844) could only be fixed by moving more of the client code into the `Provider`.

**How**:

Refactoring `next-auth/client`

Related: #1461, #1084, #1462

BREAKING CHANGE:
**1.** `next-auth/client` is renamed to `next-auth/react`.

**2.** In the past, we exposed most of the functions with different names for convenience. To simplify our source code, the new React specific client code exports only the following functions, listed with the necessary changes:

- `setOptions`: Not exposed anymore, use `SessionProvider` props
- `options`: Not exposed anymore, use `SessionProvider` props
- `session`: Rename to `getSession`
- `providers`: Rename to `getProviders`
- `csrfToken`: Rename to `getCsrfToken`
- `signin`: Rename to `signIn`
- `signout`: Rename to `signOut`
- `Provider`: Rename to `SessionProvider`

**3.** `Provider` changes.
- `Provider` is renamed to `SessionProvider`
- The `options` prop is now flattened as the props of `SessionProvider`.
- `clientMaxAge` has been renamed to `staleTime`.
- `keepAlive` has been renamed to `refetchInterval`.
An example of the changes:
```diff
- <Provider options={{clientMaxAge: 0, keepAlive: 0}}>{children}</Provider>
+ <SessionProvider staleTime={0} refetchInterval={0}>{children}</SessionProvider> 
```

**4.** It is now **required** to wrap the part of your application that uses `useSession` into a `SessionProvider`.

Usually, the best place for this is in your `pages/_app.jsx` file:

```jsx
import { SessionProvider } from "next-auth/react"

export default function App({
  Component,
  pageProps: { session, ...pageProps }
}) {
  return (
    // `session` comes from `getServerSideProps` or `getInitialProps`.
    // Avoids flickering/session loading on first load.
    <SessionProvider session={session}>
      <Component {...pageProps} />
    </SessionProvider>
  )
}
```
2021-06-11 21:59:36 +02:00
Balázs Orbán
ed345346db fix(ts): add AzureAD to OAuthProviderType 2021-06-10 20:11:12 +02:00
Ben
5ac1db741a feat(provider): refactor Azure AD, B2C providers (#1591)
BREAKING CHANGE: 

If you currently use `AzureADB2C`, you will need to update it to to `AzureAD` There should be no other changes needed.
2021-06-10 20:09:34 +02:00
Balázs Orbán
0c17af969e Merge branch 'main' into next 2021-06-10 14:49:36 +02:00
Lluis Agusti
832d51f10e test(client): add more tests (#2135)
Contains the following squashed commits:

* test(client): verify CSRF Token fetch
* test(client): verify `getProviders` logic
* test(client): verify `useSession` happy path
* test(coverage): initial coverage setup (trial)
* chore(test): fix coverage reporting
* chore(test): define report directory for codecov

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-10 11:42:58 +02:00
Balázs Orbán
29862ac887 fix(build): do not run husky on postinstall (#2158) 2021-06-10 00:24:06 +02:00
Christopher Betz
5aa2b61b88 feat(provider): add Coinbase provider (#2153)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-09 22:46:12 +02:00
Nicholas Chiang
929c644653 docs(client): fix callback anchor links (#2151) 2021-06-09 22:19:26 +02:00
Nicholas Chiang
2657e72e81 docs(callbacks): don't use signIn for redirects (#2150)
Specifies that you shouldn't use the `signIn` callback for arbitrary redirects. Instead, use the `callbackUrl` option or the redirect callback.
2021-06-09 22:17:45 +02:00
Apoorv Taneja
8ff7dbb18f docs(tutorial): Adding a YouTube link for NextAuth.js introduction (#2047)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-06-09 17:04:41 +02:00
Tom Richter
ea9b6e37a9 fix(provider): convert github profile id from int to string (#2108) 2021-06-09 17:02:52 +02:00
Manish Kumar
748d576a5a docs(adapter): align DynamoDB docs with source code (#2125)
* Updated DynamoDB Adaptor documentation

* Update dynamodb.md

* Update dynamodb.md

* Update dynamodb.md
2021-06-09 17:01:00 +02:00
Balázs Orbán
960bc1e9c0 feat(adapter): remove adapters from core (#1919)
* feat(adapter): remove built-in adapters and database

BREAKING CHANGE:

From now on, you will have to import your own adapter

Check out https://github.com/nextauthjs/adapters

The migration is super easy and has HUGE advantages for those not using TypeORM.

```diff
// [...nextauth].js
+ import TypeORMAdapter from "@next-auth/typeorm-legacy-adapter"
import NextAuth from "next-auth"

...
export default NextAuth({
-  database: "yourconnectionstring",
+ adapter: TypeORMAdapter("yourconnectionstring")
})
```


Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Giovanni Carnel <479046+g10@users.noreply.github.com>
2021-06-09 14:45:13 +02:00
Balázs Orbán
d29e3e9c9d Merge branch 'main'
Conflicts:
	config/babel.config.json
	package-lock.json
	package.json
	src/server/index.js
	src/server/routes/callback.js
	src/server/routes/signin.js
2021-06-09 02:16:11 +02:00
Camille Gabrieli
9f16e3f0fb docs(client): fix typo (#2139) 2021-06-08 09:02:41 +02:00
Adrian Artiles
1042e9a93d docs: fix typos (#2136) 2021-06-08 08:57:13 +02:00
Nico Domino
aa57f2dd7e docs(prisma-legacy): update tip location
Move client tip up to client section of docs
2021-06-07 22:44:04 +02:00
Nico Domino
1817286ce3 Update pouchdb.md 2021-06-07 22:21:39 +02:00
Nico Domino
b942dd34f3 docs(pouchdb): add pouchdb page (#2140) 2021-06-07 17:10:42 +02:00
Lluis Agusti
4d9622e1cc chore(git): fix git hooks (#2130)
Contains the following squashed commits:

* chore(git): fix husky pre-commit
* chore(husky): install git hooks on `postinstall`
2021-06-04 12:55:41 +02:00
sanctuxm
a7eadf80e5 docs(provider): fix ngrok typo on instagram provider docs (#2121) 2021-06-03 10:35:07 +02:00
Manish Kumar
75c7dbc3e7 docs(adapter): fix file location in DynamoDB docs (#2120) 2021-06-03 10:11:45 +02:00
Yi-Ru Lin
d36b89cb12 feat(provider): add Zoom provider (#2110)
* feat(provider): add Zoom provider

* Update src/providers/zoom.js

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

* Update src/providers/zoom.js

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

* Update www/docs/providers/zoom.md

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

* fix: syntax error

* Update www/docs/providers/zoom.md

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

* Update www/docs/providers/zoom.md

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

* Update www/docs/providers/zoom.md

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

* remove the default protection setting of Zoom for now

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-06-03 00:44:22 +02:00
Nico Domino
349cd03fbd docs(adapters): update adapter install instructions to canary branch (#2119) 2021-06-02 23:50:01 +02:00
Lluis Agusti
5cd130669b chore(lint): format files on pre-commit (#2117)
Contains the following squashed commits:

* chore(lint): run prettier on pre-commit
* chore(lint): format files on pre-commit
* chore(npm): update lock file
2021-06-02 13:59:53 +02:00
Lluis Agusti
638233f4a0 docs(readme): update release flow badge 2021-06-01 18:01:22 +02:00
Lluis Agusti
37e175195f chore(github): re-organize workflows (#2109)
Contains:

* chore(github): re-organize workflows
* chore(github): rename workflows structure
2021-06-01 17:52:17 +02:00
Lluis Agusti
e8a9e8aeb6 fix(client): unit tests setup and providers error handling (#1992)
* test(client): initial Jest + RTL setup

* test(client): add tests for `getSession`

* test(client): document expect cases and fix regex

* test(client): small refactors

* chore(npm): re-generate package-lock.json

* test(client): initial test for `signIn`

* test(client): refactor session tests for consistency

* test(client): credentials/email signin scenarios

* test(client): finish sign-in tests

* chore(github): add test to ci

* test(client): refactor and extend use cases

* test(client): sign-out tests

* refactor(client): code review suggestions (1)

* test(client): add few more sign-in/sign-out cases

* test(client): broadcasting session events

* fix(client): handle fetch providers error
2021-06-01 17:12:13 +02:00
Balázs Orbán
1fb308a6f4 docs(adapter): correct npm install script 2021-06-01 00:44:07 +02:00
Paul van Dyk
613c303315 docs: fix spelling in docs (#2105)
`restriected` => `restricted`
2021-05-31 19:22:39 +02:00
Nico Domino
d24fe1cebb docs: add error + warning pages to sidebar (#2100) 2021-05-31 02:14:27 +02:00
Manten
885b02ca95 chore(dev): add property to decrypt JWT (#2095) 2021-05-31 01:07:46 +02:00
Balázs Orbán
f218697fd6 docs(adapter): remove unnecessary section from prisma 2021-05-30 23:22:00 +02:00
Balázs Orbán
dbead0ad85 docs(adapter): fix API mixup in legacy adapter 2021-05-30 23:17:57 +02:00
Nico Domino
704ded5310 docs(prisma): add prisma-legacy separate docs page (#2097) 2021-05-30 21:44:58 +02:00
Manten
25fbcb4648 docs(FAQ): fix typo (#2088) 2021-05-29 16:47:06 +02:00
Nico Domino
53a439b44b docs(firebase): update firebase usage and options (#2076)
* docs(firebase): update firebase usage and options

* docs(firebase): add firebase tips/warnings

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-28 16:05:15 +02:00
Ben Orozco
16a2e37fd6 feat: Allow client to override scope (#2079)
* Ref[Signin]: Allow client to override scope

Allow client to override `scope` via query params

* Doc[Client]: Signin no longer overrides scope server-side
2021-05-28 10:07:42 +02:00
Colby Fayock
0392a8df9a docs(website): add Twitter Provider tutorial 2021-05-26 09:29:08 +02:00
Olav Fosse
a459b95c5b docs(website): fix typo (#2061) 2021-05-25 20:53:37 +02:00
Balázs Orbán
13df7eb81d docs: update urls to .vercel.app (#2039) 2021-05-25 00:35:57 +02:00
Kiran Paul
62f261209c docs(provider): improve authorize code example (#2046)
* Updated user fetch code as per review comments
2021-05-24 16:54:50 +02:00
Nico Domino
da43d0d896 docs(adapters): reorganise adapter docs for new pkg (#2051)
* docs(adapters): reorganise adapter docs for new pkg

* docs(adapters): fix link typos

* docs(adapters): add vercel.json redirects for new adapters URLs
2021-05-23 22:16:14 +02:00
Ben West
4b1271ba75 docs: Remove claim that new users do not have an ID (#1737)
I'm not sure when this changed, but it's no longer true. If the person logging in doesn't have a stored user account, the ID will be the provider_account_id
2021-05-22 13:47:48 +02:00
Marshall Bowers
d30da0170f fix(provider): make WorkOS domain configurable from signIn (#2038)
* Don't pass `domain` to the WorkOS provider

* Update docs

* Change `apiUrl` to `domain`
2021-05-22 13:40:48 +02:00
Nico Domino
887b2985fc docs(adapters): update copy regarding adapters (#2026)
* docs(adapters): update copy regarding adapters

* docs(adapters): add prisma schema page

* docs(adapters): add fauna schema/setup page

* docs(adapters): address PR comments

* Update www/docs/schemas/adapters.md

Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(adapters): update adapters.md

* docs(adapters): update adapters.md

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-22 12:10:26 +02:00
Nico Domino
d2bbac1164 docs: explain where pageProps come from in Provider docs (#2016)
* docs: explain where pageProps come from in Provider docs

* chore: formatting

* docs(getting-started): add alternative client session handling methods

* docs(getting-started): update alternative client api docs
2021-05-22 11:30:38 +02:00
Balázs Orbán
35583a513d fix: ts type, and transpilation (#2037)
* fix(ts): mark getUserByEmail param as nullable

* fix(build): transpile with optional-catch-binding
2021-05-20 20:40:45 +02:00
Nico Domino
665d91019f style: small tweaks to navbar (#2024) 2021-05-20 16:22:31 +02:00
Daniel Sabbagh
f2b816b7b9 docs: fix minor typo (#2022)
* fix minor typo

* fix typo again

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-19 20:59:00 +02:00
Nico Domino
2e770fb0bf docs: update github PR template comments (#2025) 2021-05-19 01:11:42 +02:00
Nico Domino
e83e7231fb docs(search): add new algolia docsearch (#2023)
* docs(search): add new algolia docsearch

* style(search): fix algolia docsearch mobile style
2021-05-18 21:49:43 +02:00
Marco Valsecchi
4593ec8b01 docs(provider): Fix Using a custom OAuth Provider index link (#2019) 2021-05-18 14:30:17 +02:00
Nico Domino
12517f629b docs(style): add github star counter to navbar (#2015)
* docs(style): add github star counter to navbar

* chore: cleanup kFormatter logic
2021-05-18 00:23:44 +02:00
Balázs Orbán
77012bc00c fix(deps): pin down legacy adapter versions (#2009)
* fix(deps): pin down legacy adapter versions

* chore: trigger github actions
2021-05-16 20:52:04 +02:00
Chalk
60fdf26a56 fix(provider): support multiple image formats for Twitter profile (#1995)
see supported formats: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/manage-account-settings/api-reference/post-account-update_profile_image

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-15 23:28:34 +02:00
Igor Danchenko
0fae0c7a8e feat(provider): forward request to authorize (#1979)
* feat/add-request-to-credentials-authorize

* Update src/server/routes/callback.js

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

* Update types/providers.d.ts

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

* Update www/docs/providers/credentials.md

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

* Update www/docs

* Update test app

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-05-15 03:00:39 +02:00
Nico Domino
eba79f4445 feat: upgrade docusaurus + style a bit (#1993) 2021-05-13 23:24:02 +02:00
Balázs Orbán
e3bb9881ea chore(dev): fix dev app imports (#1991) 2021-05-13 12:36:28 +02:00
Balázs Orbán
827049cb35 docs(www): Docusaurus webpack 5 (#1989)
This reverts commit bc9805d1ba.
2021-05-13 01:28:36 +02:00
Nico Domino
ad8100d402 docs: max cookie size information (#1949)
* fix: max cookie information

* fix: typo

* fix: wording regarding cookie size

* Update www/docs/faq.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-05-12 10:22:08 +02:00
dependabot[bot]
7b5defff16 chore(deps): bump hosted-git-info from 2.8.8 to 2.8.9 (#1976)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-05-12 10:20:24 +02:00
Balázs Orbán
bc9805d1ba docs: revert "Docusaurus webpack 5" (#1982)
This reverts commit c823016b36.
2021-05-12 10:19:30 +02:00
Sébastien Lorber
c823016b36 docs(www): update Docusaurus to webpack 5 (#1826)
* upgrade

* upgrade

* fix lunr plugin bug

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-12 10:01:33 +02:00
dependabot[bot]
ca0f4c6fba chore(deps): bump hosted-git-info from 2.8.8 to 2.8.9 in /www (#1977)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 21:04:27 +02:00
Balázs Orbán
c0d2f2d852 fix(adapter): upgrade legacy adapters (#1952)
* refactor(adapter): upgrade typeorm-legacy-adapter

* fix(ts): correct exported typeorm types

* fix(adapter): correct adapter exports

* chore(deps): upgrade typeorm-legacy-adapter

* chore(deps): upgrade dependencies

* chore: match comment for legacy adapters

* fix(ts): correctly export Prisma legacy types

* chore(deps): upgrade prisma legacy adapter

* chore(deps): remove unused dependencies

* test(ts): only run TS tests on latest TS version

* chore(deps): remove unused dev dependencies

* chore(deps): upgrade prisma adapter
2021-05-11 00:15:01 +02:00
Balázs Orbán
71f63117a9 fix(oauth): correctly set internal protection value (#1962) 2021-05-09 23:00:06 +02:00
i-palindrome-i
d04ce29314 feat(provider): add WorkOS provider (#1939)
* feat(provider): add WorkOS provider

* Update www/docs/providers/workos.md

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

* Update workos.md

Co-authored-by: Adam Kaczmarek <adamkaz+workos@gmail.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-05-09 21:45:37 +02:00
Lluis Agusti
d2882f1958 fix(deps): unpin react-dom version (#1956) 2021-05-09 21:43:51 +02:00
Lluis Agusti
66db563ca5 docs(provider): link to providers' source code (#1955) 2021-05-09 21:41:28 +02:00
Marcus Reinhardt
9619077363 docs(typeorm): update link to source (#1957) 2021-05-08 23:37:55 +02:00
dependabot[bot]
013ccb4cb0 chore(deps): bump lodash from 4.17.19 to 4.17.21 (#1954)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-08 00:40:35 +02:00
dependabot[bot]
6eb41259d1 chore(deps): bump underscore from 1.10.2 to 1.13.1 (#1951)
Bumps [underscore](https://github.com/jashkenas/underscore) from 1.10.2 to 1.13.1.
- [Release notes](https://github.com/jashkenas/underscore/releases)
- [Commits](https://github.com/jashkenas/underscore/compare/1.10.2...1.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 17:58:22 +02:00
Nico Domino
141f8d07e2 docs(provider): clarify where user is created with email provider (#1950) 2021-05-07 00:54:52 +02:00
Zack Sheppard
ffd0601ab0 fix(ts): improve events handlers' types (#1853)
* Constrain the adapters type generics more accurately

* Add types for the incoming messages to events callbacks

* Code review comments from @lluia

* Rebase from trunk and fix merge conflicts

* Update documentation

* Rip out generics

* fix(build): export aliases from client (#1909)

* docs(provider): update providers documentation (#1900)

* docs(providers): update providers documentation

- delineate clearly the 3 provider types (oauth, email, credentials)
- make each section structure consistent
- update the option list for every provider type
- use emojis

* docs(providers): instructions on new provider types

* docs(providers): remove emojis

To stay consistent with the rest of our documentation, for now we should not emojis on the sections of our documentation pages.

* docs(providers): reword sentence

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

* docs(providers): add tip on overriding options

* docs(providers): clarify `params` option usage

* docs(providers): make names list inline

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

* fix(ts): unset generics defaults for overriding (#1891)

Co-authored-by: Lluis Agusti <hi@llu.lu>

* fix(ts): tweak Adapter related types (#1914)

Contains the following squashed commits:

* fix(ts): make first adapter parameter non-optional
* fix(ts): make defaulted values non-optional internally
* test(ts): fix linting

* fix(page): don't pass params to custom signout page (#1912)

* For the custom signout page addressed two issues with the query params being added to the signout url. A conditional check on the error value is now made before adding it as a query param. Also added a conditional check on the callbackUrl and if present that then gets appended as a query param to the signout api call.

* Changed fix for bug #192 to have no querystring params in the custom signout page url.

Co-authored-by: anubisoft <anubisoftprez@gmail.com>
Co-authored-by: Lluis Agusti <hi@llu.lu>

* docs(www): fix typo (#1922)

* docs(provider): Update IdentityServer 4 demo configuration (#1932)

* Responding to code review comments

* Fix tests

* Fix lint error

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Kristóf Poduszló <kripod@protonmail.com>
Co-authored-by: Anubisoft <1471887+anubisoft@users.noreply.github.com>
Co-authored-by: anubisoft <anubisoftprez@gmail.com>
Co-authored-by: Ernie Miranda <emiranda04@users.noreply.github.com>
Co-authored-by: Mathis Møller <thisen-dk@hotmail.com>
2021-05-06 11:44:30 +02:00
Lluis Agusti
7864d4705d docs(adapter): mention new types (#1916)
Containts the following squashed commits:

* docs(adapters): mention new types
* docs(adapters): rename interface on example
* docs(adapters): move section above
* docs(adapters): fix casing
* docs(adapters): fix example import
* fix(www): Typescript -> TypeScript
2021-05-06 11:10:37 +02:00
i-palindrome-i
98dc82e5d6 docs: fix command in CONTRIBUTING.md (#1940)
Co-authored-by: Adam Kaczmarek <adamkaz+workos@gmail.com>
2021-05-06 10:19:50 +02:00
Balázs Orbán
86baefdd9d feat(adapter): take away error handling from adapters (#1871) 2021-05-05 19:45:11 +02:00
Manish Chiniwalar
332e237c3e feat(provider): add Dropbox (#1756)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Adam Bergman <adam@fransvilhelm.com>
2021-05-05 19:42:55 +02:00
Mathis Møller
2fce08c0b5 docs(provider): Update IdentityServer 4 demo configuration (#1932) 2021-05-05 15:17:22 +02:00
Ernie Miranda
adf3fb669f docs(www): fix typo (#1922) 2021-05-04 19:34:06 +02:00
Anubisoft
5323be3594 fix(page): don't pass params to custom signout page (#1912)
* For the custom signout page addressed two issues with the query params being added to the signout url. A conditional check on the error value is now made before adding it as a query param. Also added a conditional check on the callbackUrl and if present that then gets appended as a query param to the signout api call.

* Changed fix for bug #192 to have no querystring params in the custom signout page url.

Co-authored-by: anubisoft <anubisoftprez@gmail.com>
Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-03 22:43:38 +02:00
Balázs Orbán
6df0d04a1e fix(ts): tweak Adapter related types (#1914)
Contains the following squashed commits:

* fix(ts): make first adapter parameter non-optional
* fix(ts): make defaulted values non-optional internally
* test(ts): fix linting
2021-05-03 21:24:19 +02:00
Balázs Orbán
a388b44d0b Merge branch 'main' into next 2021-05-03 21:11:04 +02:00
Kristóf Poduszló
aa9c1e7c96 fix(ts): unset generics defaults for overriding (#1891)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-03 14:31:56 +02:00
Lluis Agusti
66473054f5 docs(provider): update providers documentation (#1900)
* docs(providers): update providers documentation

- delineate clearly the 3 provider types (oauth, email, credentials)
- make each section structure consistent
- update the option list for every provider type
- use emojis

* docs(providers): instructions on new provider types

* docs(providers): remove emojis

To stay consistent with the rest of our documentation, for now we should not emojis on the sections of our documentation pages.

* docs(providers): reword sentence

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

* docs(providers): add tip on overriding options

* docs(providers): clarify `params` option usage

* docs(providers): make names list inline

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-05-02 22:07:08 +02:00
Balázs Orbán
e8ddbc5c11 fix(build): export aliases from client (#1909) 2021-05-02 12:11:11 +02:00
Ernie Miranda
dfe4620056 docs(www): fix minor typo. (#1902)
Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-05-01 11:09:01 +02:00
leeoocca
848224e2c5 fix(ts): optional variables for custom provider options (#1876)
Contains the following squashed commits:

* fix optional variables for custom provider options
* revert some types for custom provider
* docs: client secret required in provider options
* Revert "docs: client secret required in provider options"
2021-05-01 10:46:04 +02:00
dependabot[bot]
aee376cc57 chore(deps): bump ssri from 6.0.1 to 6.0.2 in /www (#1901)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 21:17:23 +02:00
Amir Ali
0d2a81cd39 docs(www): syntax error on JWT_SESSION_ERROR code example (#1899) 2021-04-30 16:51:02 +02:00
Balázs Orbán
61e99c9489 fix(ts): wrap adapter option in ReturnType (#1887)
* fix(ts): wrap adapter option in ReturnType

* test(ts): fix adapter tests
2021-04-29 19:43:34 +02:00
Balázs Orbán
0eb4159737 fix(ts): fix updateSession return type 2021-04-28 22:23:13 +02:00
Balázs Orbán
9f0008375f fix(ts): fix createVerificationRequest type (#1877) 2021-04-28 22:16:09 +02:00
leeoocca
0cf1823e70 docs: fix typos in custom provider page (#1875)
* fix typo on custom provider options table

* fix typo in custom provider code example
2021-04-28 20:49:27 +02:00
Mohamed Ouyizme
7f39669053 feat(provider): add 42 School provider (#1872)
* feat(provider): add 42 School provider

* fix(docs): fix provider import

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

* fix(provider): change provider id

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

* fix(provider): change provider id

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

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-04-28 19:10:05 +02:00
Balázs Orbán
7b82d6e985 fix(ts): typo in Adapter interface 2021-04-28 11:59:34 +02:00
Balázs Orbán
53b0a7aa74 fix(ts): improve adapter TypeScript support (#1870)
* fix(ts): clean up adapter interfaces

* fix(ts): add accessTokenExpires to TokenSet

* docs(adapter): do not recommend getUserByCredentials

* fix(ts): make whole EmailConfig required in AdapterInstance

* fix(ts): fix tests

* refactor(ts): remove legacy adapter types

Co-authored-by: Lluis Agusti <hi@llu.lu>
2021-04-28 11:20:03 +02:00
Lluis Agusti
fbb09303af docs(website): fix layout on small screens (#1869) 2021-04-27 19:30:01 +02:00
Balázs Orbán
ff05ac1e41 feat(adapter): split out adapters (#1862)
* refactor(adapter): remove example adapter

* chore(deps): add legacy adapter dependencies

* refactor(adapter): reference legacy adapters

* chore(deps): upgrade legacy adapters

* test(adapter): remove duplicate tests

* test: remove disfunctional tests

* chore: remove accidentally pushed file

* chore: revert unnecessary file changes
2021-04-27 10:01:11 +02:00
Lluis Agusti
a6f6c1590d chore(github): fix typos on issue templates (#1858)
* chore(github): fix typos on issue templates...

* chore(github): use statements rather than comments

on the PR template

* chore(github): Typescript -> TypeScript

* chore(github): add links to Codesanbox on issue templates

* Apply suggestions from code review

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-04-26 16:02:37 +02:00
Lluis Agusti
52c2466b9e chore(github): update PR/issue templates (#1829)
Contains the following squashed commits: 

* chore(github): update PR template
* chore(github): refine PR template again
* chore(github): improve issue templates
* chore(github): fix typos on issue templates
* chore(github): improve "affected issues" section on PR template
* chore(github): link question bug report template
* chore(github): fix typo on issue template
* chore(github): add TypeScript issue template
2021-04-26 11:58:32 +02:00
Ashutosh Kumar
fb04ab4e76 fix(ts): make GetSessionOptions optional (#1851) 2021-04-25 15:39:19 +02:00
Ashutosh Kumar
07e2a83ccb fix(ts): make ctxOrReq optional in getCsrfToken() (#1850) 2021-04-25 14:10:21 +02:00
Balázs Orbán
b6a3a72db4 Merge branch 'main' into next 2021-04-24 23:20:41 +02:00
Balázs Orbán
065d9eb310 chore(release): do not mark released PRs/issues (#1845) 2021-04-24 23:17:24 +02:00
Thanayut T
5da19f3c9a feat(provider): add WordPress.com provider (#1837) 2021-04-24 10:48:44 +02:00
Balázs Orbán
88ec3bad71 chore: move files from root 2021-04-24 00:44:08 +02:00
Lluis Agusti
5ab7868533 chore(ci): remove Node 10 and add Node 16 (#1830)
* chore(github): add CODEOWNERS

* chore(ci): remove Node 10 and add Node 16
2021-04-24 00:20:50 +02:00
Lluis Agusti
835dda0899 chore(github): add CODEOWNERS (#1827) 2021-04-24 00:17:19 +02:00
Balázs Orbán
edcb10a823 Merge branch 'main' into next 2021-04-23 15:43:20 +02:00
Balázs Orbán
2acabe19e0 Merge main into next 2021-04-23 15:28:26 +02:00
Wilkins Fernandez
ad4709764a docs: update import for providers (#1823)
Updates the names export from `providers` to `getProviders`.
2021-04-23 14:58:53 +02:00
Michał Bundyra
55a2932973 fix(ts): add Mailchimp provider (#1821) 2021-04-23 13:11:13 +02:00
Michał Bundyra
49cb7e5bd7 feat(provider): add Mailchimp provider (#1781) 2021-04-23 12:15:25 +02:00
Balázs Orbán
b95182ded7 fix(ts): expose errors type delcarations (#1817) 2021-04-22 23:45:23 +02:00
Balázs Orbán
be28672fd4 fix(errors): expose custom errors (#1816)
* chore(deps): add class-properties babel plugin

* feat(errors): expand list of custom error classes

* build(errors): expose errors as a submodule
2021-04-22 23:28:38 +02:00
Balázs Orbán
e26c5fc905 fix(ts): adjust AppOptions (#1815) 2021-04-22 23:04:27 +02:00
Balázs Orbán
543f812eb3 fix(build): export functions in jwt (#1814) 2021-04-22 19:28:17 +02:00
Joël Galeran
0c9f9777c5 docs(adapter): Remove --preview-feature flag (#1807)
* Remove --preview-feature flag

* Update [...nextauth].js
2021-04-22 18:11:30 +02:00
Balázs Orbán
34f334a71d fix(ts): make Profile/User interfaces overridable (#1801)
* fix(ts): create DefaultUser interface

* fix(ts): fix TypeORMUserModel

* fix(ts): create DefaultProfile
2021-04-22 01:04:23 +02:00
Balázs Orbán
172ad02f8c fix(ts): move AppProvider out of internals (#1800)
* fix(ts): move AppProvider out of internals

* fix(ts): fix import paths
2021-04-21 23:09:42 +02:00
Balázs Orbán
eed0001524 fix(ts): adjust properties on default interfaces (#1794)
* fix(ts): adjust properties on default interfaces

* fix(ts): make expires also optional

* fix(ts): don't require default session/jwt fields

* fix(ts): make all default fields optional
2021-04-21 17:17:38 +02:00
Gabrijel Gavranović
a2705fb5b9 fix(client): export getCsrfToken directly to support Webpack 5
Fixes `Attempted import error: 'getCsrfToken' is not exported from 'next-auth/client' (imported as 'getCsrfToken’).`-error.
2021-04-21 17:14:12 +02:00
Balázs Orbán
cb1e5a7174 docs(dev): add readme to dev app 2021-04-21 00:00:57 +02:00
Balázs Orbán
8cba5d06b5 build(provider): filter index.js to be more forgiving 2021-04-20 23:17:18 +02:00
Balázs Orbán
c52ce57296 fix: add skypack recommended fields (#1791) 2021-04-20 22:40:12 +02:00
Balázs Orbán
4dae822806 chore: move dev app into its own folder (#1753)
* chore: move dev app to its own folder

* docs: update CONTRIBUTING.md

* docs: fix typos in CONTRIBUTING

* chore: gitignore dev app lock files

* chore: move release config into package.json
2021-04-20 22:25:51 +02:00
Lluis Agusti
901f6fb189 docs: mention TS example repo on the website (#1786)
* docs(www): mention TS example repo

* Update www/docs/getting-started/typescript.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-04-20 21:40:06 +02:00
Balázs Orbán
bb2237d0f9 fix(build): remove unnecessary build before release 2021-04-20 21:35:10 +02:00
Balázs Orbán
fab7ce8f94 fix(build): trigger re-release 2021-04-20 21:33:01 +02:00
Balázs Orbán
2becdad990 fix(logger): attempt at fixing infinite loop (#1789) 2021-04-20 21:22:20 +02:00
Pop Stefan
e3c2c7756d docs: add Class components tutorial (#1784) 2021-04-20 17:34:05 +02:00
Balázs Orbán
718f2537cb build(provider): auto-generate Providers submodule (#1782) 2021-04-20 17:33:24 +02:00
dogomedia-github
ae26df091d fix(provider): add sub to defaultJwtPayload for credentials provider. (#1725)
Co-authored-by: Joseph Chen <jchen@dogomedia.com>
2021-04-20 12:59:48 +02:00
dependabot[bot]
1cbf73b2f6 chore(deps): bump jose from 1.27.2 to 1.28.1 (#1772)
Bumps [jose](https://github.com/panva/jose) from 1.27.2 to 1.28.1.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/v1.28.1/CHANGELOG.md)
- [Commits](https://github.com/panva/jose/compare/v1.27.2...v1.28.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 12:56:07 +02:00
Balázs Orbán
46b62d723c feat(ts): expose types from main package (#1773)
* chore: add beta to release flow/GH actions

* feat(ts): expose types from the package (#1665)

* chore(types): move existing types to the repo
* feat(ts): expose types from the main package
* chore(deps): bring back `react-dom` version range
* chore(ts): cleanup deps and comments
* chore(ci): run types tests on a separate workflow

* chore(ci): fix typo on types workflow

* fix(ts): correctly export sub-module types (#1677)

* chore(types): build types script

Adds a script that moves the declaration files we have in `./types` to `./dist` relative to the files they intend to type.

This is the first step, we still need to change what we declare in `package.json`, add the script to the CI pipeline if we're happy with it and figure out how to type `next-auth/jwt`.

* refactor(lint): fix build-types script

* fix(ts): add .d.ts sub-module files to package.json

#1677 seemed to miss this

* fix(built): typo in package.json

* fix(build): fix release

* feat(ts): support module augmentation (#1681)

* chore(ts): remove unused imports

* refactor(ts): clean up CallbackOptions

* docs(ts): explain Module Augmentation

* docs(ts): don't use @ in folder name "types"

* test(ts): make jwt params optional

* docs(ts): fix typo (TypeScript -> NextAuth.js)

* style: replace ts-standard with eslint/prettier (#1724)

* style: move from ts-standard to eslint/prettier

* fix: install remaining eslint-config-standard peer deps

* fix: add remaining missing dependencies/config

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

* docs(lint): update contributing.md (#1760)

Regarding ESLint / Prettier use and link to their VSCode extensions

* refactor(ts): de-duplicate types (#1690)

* refactor(ts): deduplicate internal types

* refactor(ts): ease up providers typings

* test(ts): fix failing TS tests

* test(ts): rename TS property to fix test

* docs(ts): mention TS docs in README.md

* feat(ts): move/update client types

* refactor(TS): rename some types

* test(ts): fix client tests

* docs(ts): move function descriptions to .d.ts

* chore: fix lint error

* refactor(ts): separate internal types

* chore: simplify build-types script

* chore: update type import paths in src

* chore(build): create root files at build

* chore: remove unnecessary .npmignore

* chore: run prettier on types

* fix(ts): clean up jwt types

* fix(ts): make getToken return type depend on raw param

* docs(page): explain page errors, add theming note

* docs(ts): add JSDoc to NextAuthOptions props

* chore(ts): remove unused import

* docs(ts): change JSDOC docs notation

* refactor(build): extract module entries into enum

* chore(ts): move ClientSafeProvider

* chore(ts): simplify GetTokenParams generic

* style(lint): fix linting errors

* chore: re-add generic extension to GetTokenParams

* fix(ts): extract EmailConfigServerOptions to interface

* fix(ts): use relative imports

* Merge branch 'main' into beta

* Merge main into beta

* fix(ts): fix typos, add more links to documentation

* test(ts): update JWT getToken test

* fix(build): fix tsconfig.json formatting

* test(ts): use absolute imports in test files

* fix(ts): add missing callbacks JSDoc

* docs: mention TS in FAQ, fix typos

* docs: fix some typos in the docs

Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Nico Domino <yo@ndo.dev>
2021-04-20 12:20:43 +02:00
Balázs Orbán
457952bb5a fix(jwt): make decode overrideable in getToken (#1751) 2021-04-17 12:40:50 +02:00
Balázs Orbán
a6f5f4c184 fix: use upgraded require optional (#1743)
* chore(deps): switch back to (updated) require_optional

* fix: use @balazsorban/require-optional
2021-04-16 16:05:44 +02:00
Balázs Orbán
9fa93e3b5e fix(build): use optional-require dependency (#1736)
* chore(deps): add optional-require

* refactor: use optional-require
2021-04-16 00:23:29 +02:00
Balázs Orbán
cb4342fdda feat(build): modernize how we bundle next-auth (#1682)
* feat(build): optionally include TypeORM

If the user doesn't use databases,
it shouldn't be necessary to iclude it in the bundle.
This can more than half the package size!

* feat(build): clean up in dependencies

Remove unused dependencies, move optional ones to be optional

* feat(build): add exports field

* fix: use peerDependenciesMeta instead of non-standard peerOptionalDependecns field

* fix: ts-standard string quotes

* fix: ts-standard string quotes

* refactor: use asnyc/await for sendVerificationRequest

* chore(deps): upgrade mongodb, remove require_optional

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

BREAKING CHANGE:
`typeorm`, and `nodemailer` are no longer dependencies added by default.
If you need any of them, you will have to install them yourself in your project directory.
TypeOrm is the default adapter, so if you only provide an `adapter` configuration or a `database`, you will need `typeorm`. You could also check out `@next-auth/typeorm-adapter`. In case you are using the Email provider, you will have to install `nodemailer` (or you can use the choice of your library in the `sendVerificationRequest` callback to send out the e-mail.)
2021-04-15 23:40:33 +02:00
Balázs Orbán
17b789822d fix: make oauth_token_secret and oauth_token available (#1322)
* fix: add oauth_token_secret to requests

* chore: remove console.log

* refactor: follow casing from response
2021-04-14 21:26:15 +02:00
Ovidiu Dan
fd12194c0c docs(provider): Explain how to get access to LinkedIn authentication (#1706) 2021-04-12 18:46:20 +02:00
Balázs Orbán
1c662e9ddc fix(page): fall back to default error page (#1700) 2021-04-12 03:56:47 +02:00
Balázs Orbán
5f717b3914 chore: merge main into next 2021-04-12 00:46:27 +02:00
Balázs Orbán
968903d227 fix(oauth): support response_mode=form_post (#1669)
* chore: alias dev script to next

* feat(core): fallback to body when reading state

* refactor: set csrfToken on req.options implicitly

Ensures we do this similarly than
in other handlers like pkce, state, extendRes, callbackUrlHandler etc.

* chore: add code comment for debugging
2021-04-12 00:24:05 +02:00
Balázs Orbán
3dedf6c26c fix(provider): proper check of protection property (#1694)
* fix(provider): proper check of protection property

* chore: add comment
2021-04-12 00:15:29 +02:00
Amauri Dias
d1dbfe1023 fix: truly replace .flat() to support Node <11 again (#1691) 2021-04-11 23:20:37 +02:00
David Colón
63171a0271 fix: validate provider existence before looking for protection property (#1687)
* Fix validation of provider existence before looking for protection property

* Use optional chaining
2021-04-11 15:20:01 +02:00
Amauri Dias
872e180339 fix: replace .flat() to support Node <11 again (#1684) 2021-04-11 10:57:25 +02:00
ifly7charlie
a7709df796 docs: Document the additional parameters in JWT (#1550)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-04-08 14:00:19 +02:00
Balázs Orbán
dbe283f0fa refactor: rename extend-res to extend-req 2021-04-07 22:26:54 +02:00
Balázs Orbán
727426bbec chore(ts): auto-label TypeScript related changes 2021-04-07 20:16:10 +02:00
Vinicius CR
5a3ee47337 feat(provider): accept array for protection to support multiple mechanisms (#1565)
* fix: add protection both option

* feat: update docs with new protection value

* fix: lint files

* refactor: change protection from string to array

* chore: reverting unespected change

* chore: lint files

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-04-06 19:20:56 +02:00
bhaveshmishra-code
8dd8f7c48a docs: fix typo in callbacks.md (#1657)
Fixed the spelling mistake.

existance -> existence
2021-04-05 19:35:26 +02:00
Jaime Martínez Rincón
072c59d85a docs: fix typo primsa (#1652) 2021-04-05 00:25:46 +02:00
dependabot[bot]
d0e8147a48 chore(deps): bump y18n from 4.0.0 to 4.0.1 (#1631)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 00:24:39 +02:00
Jasper Moelker
5bc8f8b986 docs(page): correct getCsrfToken and input types (#1651)
This fixes the a mismatch between the import (`csrfToken`) and the method (`getCsrfToken`) used in `getInitialProps`/`getServerSideProps`.
In addition the form input fields now have their correct type: `email` for email input (for better autocomplete, virtual keyboard support and native validation) and `password` for the password input (to hide password while typing).
2021-04-04 22:01:53 +02:00
hoangbits
136361e1f4 docs: rename command to vercel cli, now cli is deprecated (#1647) 2021-04-04 11:02:38 +02:00
hoangbits
cc9869592c docs: fix typo in providers.md (#1641) 2021-04-02 17:18:40 +02:00
Jay Liew
073da60c3d docs: Update pages.md (#1592)
* Update pages.md

Updated Credentials Sign-In code example to indicate how to use `getServerSideProps` but still also showing the older `getInitialProps` example

* Update www/docs/configuration/pages.md

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

* update documentation to show example using getServerSideProps()

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Jay Liew <jay@haute.tech>
2021-03-31 00:31:31 +02:00
ifly7charlie
aacc34bbfd docs(error): Add missing error message and technique to resolve (#1549)
* Add missing error message and technique to resolve

* Update errors.md

Correct with correct error message and more complete suggestions on resolving it
2021-03-26 23:09:21 +01:00
jgollhardt
074688d10e docs(provider): fix wrong param name in sendVerificationRequest example (#1595) 2021-03-26 23:01:25 +01:00
Balázs Orbán
d09a45ec7c chore: merge main into next 2021-03-26 16:23:35 +01:00
Macarse, Christian Ryan R
b3ffe50c03 docs(provider): removed misleading provider signin link (#1588) 2021-03-25 22:30:46 +01:00
Shubham Shukla
e6d063825d fix(provider): added options in instagram provider (#1570) 2021-03-23 22:28:54 +01:00
Balázs Orbán
985f7b3431 fix(logger): properly end request every time (#1557)
* fix(logger): properly end request every time

* chore: fix linting
2021-03-20 10:08:12 +01:00
Max
237b016378 fix(provider): reject access token if slack login flow was canceled (#1544)
* fix: reject access token if slack login flow was canceled

* style: fix lint errors in oauth client
2021-03-18 14:59:24 +01:00
Joshua Williams
776b9480da feat(provider): add Zoho provider (#1516)
* feat(provider): add zoho

* fix: use LF instead of CRLF

* fix: crlf to lf line endings

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-03-16 19:27:11 +01:00
Honman Yau
07a3f76cb3 docs: fix typos in REST API guide (#1528) 2021-03-16 19:25:24 +01:00
tclaude94
3726d68c49 feat(provider): add FACEIT provider (#1469) 2021-03-16 00:00:35 +01:00
dependabot[bot]
e31db1726a chore(deps): bump xmldom from 0.3.0 to 0.5.0 (#1510)
Bumps [xmldom](https://github.com/xmldom/xmldom) from 0.3.0 to 0.5.0.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.3.0...0.5.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-13 14:19:22 +01:00
James Perkins
a241199c11 docs(tutorials): Adding two more tutorials to the list.
[skip release]
2021-03-13 03:42:00 +00:00
dependabot[bot]
5385ec20a9 chore(deps): bump elliptic from 6.5.3 to 6.5.4 in /www (#1493)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-10 22:59:10 +01:00
Balázs Orbán
810d02e671 fix(deps): upgrade to latest preact-render-to-string (#1475) 2021-03-08 10:39:13 +01:00
Balázs Orbán
930f58eba3 chore: merge main into next 2021-03-08 01:05:54 +01:00
Valentin Hervieu
e5535734f8 fix(client): set useSession loading state correctly (#1468)
This is fixing #1467.

The issue was due to doing the `setLoading(false)` in the finally:  as we can do an early return [here](a7e08e2a32/src/client/index.js (L100-L100)), we would still go to the finally and mark the session as being loaded.

I simply removed the `finally` block to only set the `loading` state to false when:
- the data is ready
- an error occures
2021-03-07 19:11:32 +01:00
Taehwan Noh
ba7aed1057 feat(provider): add Kakao provider (#1459) 2021-03-06 21:52:39 +01:00
Balázs Orbán
a7e08e2a32 fix: make sure useSession populates session correctly (#1462) 2021-03-06 20:02:43 +01:00
mcha
0d13040264 docs(client): fix client.md typos (#1453) 2021-03-06 10:50:29 +01:00
Balázs Orbán
582520f8ef chore: fix typo in feature request template 2021-03-06 00:35:09 +01:00
Sam Bauch
95942519a5 feat(provider): add Osso SAML provider (#1448)
Co-authored-by: @sbauch
2021-03-06 00:21:38 +01:00
Balázs Orbán
f3e64f04cc feat(client): introduce NEXTAUTH_URL_INTERNAL (#1449)
Co-authored-by: @gergelyke
2021-03-06 00:10:36 +01:00
Balázs Orbán
ed5cc4aa65 feat(provider): add Instagram provider (#1447)
Co-authored-by: @PolMrt pol@hey.com
2021-03-05 23:39:50 +01:00
Balázs Orbán
0e20b60229 docs(database): mention CockroachDB
Co-authored-by: @jukbot <jukbot@yellotalk.co>
2021-03-05 22:52:48 +01:00
Balázs Orbán
3aee24b5dc refactor: client improvements (#1428)
* docs(client): add TS definitions to client

* docs(client): add documentation links to public methods

* refactor(client): simplify window sync, simplify logic

* refactor(client): extract repeating logic to _fetchData

* refactor(client): remove clientId

* refactor(client): use session in Provider if passed
2021-03-05 22:47:32 +01:00
Baterka
960ca85907 fix: send only the error message in callback redirects (#1424)
Changed `encodeURIComponent(error)` to `encodeURIComponent(error.message)` to remove prefix (such as `Error: ` and possible stack trace).
Seems like better way of doing it and also safer if server throws some error with sensitive data.
2021-03-05 18:34:11 +01:00
Balázs Orbán
c20b7f2930 feat: use IE11 as client code bundle target (#1402) 2021-03-03 20:25:42 +01:00
Balázs Orbán
e418cddd96 chore: merge main into next 2021-03-03 20:25:42 +01:00
Balázs Orbán
f960cc0f6f chore(docs): upgrade docs dependencies 2021-03-03 20:13:46 +01:00
Balázs Orbán
0f64f3eea7 chore: don't mark bugs as stale
Had a good laugh today 😄:

"This is not stale. Bread goes stale. Bugs don't. They don't just magically go away because time has passed" - Unknown
https://twitter.com/ericclemmons/status/1367000259046604803
2021-03-03 19:54:13 +01:00
yannicktian
71c78e8e24 feat(provider): allow disabling redirection on sign in with email (#1416)
* feat: allow to disable client-side redirect for email provider

* docs(client): mention that redirect can also be disabled for email provider

* feat: only display one email input in email page
2021-03-02 22:38:02 +01:00
dependabot[bot]
d86609a2dc chore(deps): bump prismjs from 1.22.0 to 1.23.0 in /www (#1409)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.22.0...v1.23.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 22:52:46 +01:00
Joost van Wollingen
d0c3400d30 docs(page): Remove unnecessary context param (#1406)
...when calling providers in the docs
2021-03-01 21:39:03 +01:00
Praneeth
172e79cb04 fix(page): add character encoding and page titles (#1380)
* added character encoding fix

* changed multi-line to inline and added title param to send fn in src/server/pages/index.js

* modified the return object of renderPage in src/server/pages/index.js
2021-03-01 21:17:51 +01:00
Balázs Orbán
46d5c76605 docs: reword callbacks.md
Explain the `jwt()` callback before the `session()` callback, as it comes first in the flow.
2021-02-28 18:05:10 +01:00
Zach White
438efd8a9b docs: reword pages.md (#1386)
language edits
2021-02-27 23:43:45 +01:00
Balázs Orbán
d8d497cc91 feat(provider): call generateVerificationToken async (#1378) 2021-02-27 23:33:26 +01:00
Pop Stefan
6152c8afbb docs: added refresh token tutorial link in faq page (#1385) 2021-02-27 20:24:09 +01:00
Balázs Orbán
5ae6f6118c docs: add missing comma
Thx @followbl 😺
2021-02-25 23:29:33 +01:00
sid
96ff048b59 fix(provider): use correct file type for Discord profile img (#1365) 2021-02-23 21:39:27 +01:00
Ariel Weingarten
e80f6e936d docs(provider): Update twitch.md (#1353)
State what redirect URL to add to the Twitch console.
2021-02-22 20:04:38 +01:00
Lawrence Chen
6b5a215fb2 docs(tutorials): refresh token rotation (#1310)
* docs(tutorials): refresh token rotation

* use simple initialization

* be optimistic

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

* add yarn.lock to .gitignore

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-21 22:30:01 +01:00
Balázs Orbán
782482b9f4 feat: make tokens available in profile callback (#1329)
* feat: make access_token available in profile callback

* docs(provider): mention access_token param in profile callback

* feat: send all available tokens to provider.profile
2021-02-20 22:58:48 +01:00
Balázs Orbán
2d364f246a docs: tweak release badges 2021-02-17 19:14:45 +01:00
Balázs Orbán
564b342f69 fix(docs): generate providers on docosaurus start 2021-02-16 15:42:27 +01:00
Balázs Orbán
63638d81dc docs: add sponsoring information 2021-02-16 15:42:27 +01:00
Balázs Orbán
28683015f1 docs: add links to README badges 2021-02-16 10:34:54 +01:00
Balázs Orbán
726c49603d chore: make next a prerelease channel 2021-02-16 10:20:46 +01:00
Balázs Orbán
a7113c6d3e chore: trigger release on main branch 2021-02-16 09:50:19 +01:00
Balázs Orbán
910514c6e2 chore: trigger release action on next branch 2021-02-15 21:51:17 +01:00
Balázs Orbán
111e7aabdf feat(provider): remove state property
BREAKING CHANGE: adding `state: true` is already redundant
as `protection: "state` is the default value. `state: false`
can be substituted with `protection: "state"`
2021-02-15 21:47:47 +01:00
Balázs Orbán
a113ef6fab feat: encourage returning strings instead of throwing
BREAKING CHANGE: We have supported throwing strings
for redirections, while we were showing a waring.
From now on, it is not possible. The user MUST return a string,
rather than throw it.
2021-02-15 21:47:35 +01:00
Balázs Orbán
b7cca484cf docs(provider): mention re-exporting config 2021-02-15 13:28:20 +01:00
Balázs Orbán
e293e786a8 fix(page): fallback to default error when no query param (#1303) 2021-02-11 22:25:09 +01:00
Balázs Orbán
82dd6ba3e4 feat(logger): introduce user configurable logger (#1294) 2021-02-11 14:50:53 +01:00
Balázs Orbán
6e28a07746 fix(client): reload after login/logout when url contains hash (#1298)
Co-authored-by: Thew Dhanat
2021-02-11 12:18:54 +01:00
Balázs Orbán
61047e3c14 chore: add CodeQL code analysis action 2021-02-11 09:58:22 +01:00
Balázs Orbán
dc5f3f481d chore(deps): upgrade test dependencies 2021-02-10 21:04:36 +01:00
Balázs Orbán
0343344802 chore: add new PR labels 2021-02-10 20:56:22 +01:00
Balázs Orbán
134a95a4bd docs(provider): auto-generate providers list (#1295)
* docs: ignore providers.json

* chore: generate providers.json from front-matter

* chore: remove autogenerated file

* docs(provider): rename vk.com to VK

* docs: encourage adding new providers
2021-02-10 20:43:04 +01:00
Joshua Payette
52a4bd97cd docs(provider): Update azure-ad-b2c (#1288)
It seems that the AZURE_TENANT_NAME env var is not required for next-auth.  This update removes it.

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-10 00:57:43 +01:00
Benjamin Bender
87d43e4038 docs: Update client.md (#1289)
Fix typo on getProviders()
2021-02-10 00:37:27 +01:00
Balázs Orbán
68695af1f3 chore: update release flow 2021-02-09 22:08:52 +01:00
Balázs Orbán
76df2b5e70 chore: disable semantic releases temporarily 2021-02-09 20:52:01 +01:00
Balázs Orbán
8bd9d87633 feat: new release (#1259)
* feat: simplify NextAuth instantiation (#911)

* feat: allow react 17 as a peer dependency (#819)

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

* docs: update for Now to Vercel (#847)

Vercel archived their now packages a while back, so you can use vercel env pull to pull in the .env

* docs: fix discord example code (#850)

* docs: fix typo in callbacks.md (#815)

This is a simple typographical error changed accesed to accessed

* fix: update nodemailer version in response to CVE. (#860)

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7769 reports a high-severity issue with the current version of nodemailer. This should be merged and released right away if possible.

* fix: ensure Images are produced for discord (#734)

* fix: update Okta routes (#763)

the current routing for the Okta provider does not follow the standard
set by Okta, and as such doesn't allow for custom subdomains. this
update amends the routes to allow for customer subdomains, and also
aligns next-auth with Okta's documentation.

* fix(provider): handle no profile image for Spotify (#914)

* chore(deps): upgrade "standard"

* style(lint): run lint fix

* fix(provider): optional chain Spotify provider profile img

* Merge main into canary (#917)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* docs: Update default ports for support Databases (#839)

https://next-auth.js.org/configuration/databases

* Fix for Reddit Authentication (#866)

* Fixed Reddit Authentication

* updated fix for build test

* updated buffer to avoid deprecation message

* Updated for passing tests

* WIP: Update Docusaurus + Site dependencies (#802)

* update: deps

* fix: broken link

* fix: search upgrade change

* Include callbackUrl in newUser page (#790)

* Include callbackUrl in newUser page

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <me@iaincollins.com>

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <me@iaincollins.com>

Co-authored-by: Iain Collins <me@iaincollins.com>
Co-authored-by: Nico Domino <yo@ndo.dev>

* add(db): Add support for Fauna DB (#708)

* Add support for Fauna DB

* Add integration tests

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

* feat(provider): add netlify (#555)

Co-authored-by: styxlab <cws@DE01WP777.scdom.net>
Co-authored-by: Balázs Orbán <info@balazsorban.com>

* Bump next from 9.5.3 to 9.5.4 in /test/docker/app (#759)

Bumps [next](https://github.com/vercel/next.js) from 9.5.3 to 9.5.4.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v9.5.3...v9.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nico Domino <yo@ndo.dev>

* feat(provider): Add Bungie (#589)

* Add Bungie provider

* Use absolute URL for images

* Correct image URL and use consistent formatting

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

* feat: add foursquare (#584)

* feat(provider): Add Azure Active Directory B2C (#921)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* doc: add provider to FAQ

* update(provider): Update Slack provider to use V2 OAuth endpoints (#895)

* Update Slack to v2 authorize urls, option for additional authorize params
* acessTokenGetter + documentation

* refactor(db): update Prisma calls to support 2.12+ (#881)

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Nico Domino <yo@ndo.dev>

* chore(dep): Bump highlight.js from 9.18.1 to 9.18.5 (#880)

Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.18.1...9.18.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Nico Domino <yo@ndo.dev>

* chore: disallow issues without template

* chore: add note about conveting questions to discussions

* chore: create PULL_REQUEST_TEMPLATE.md

* chore: reword PR template

* feat: Store user ID in sub claim of default JWT (#784)

This allows us to check if the user is signed in when using JWTs

Part of #625

* docs: fix incorrect references in cypress docs (#932)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a7af.

* chore: add myself to the contributors list 🙈

* docs: fix incorrect references in cypress docs

* chore: add additional docs clarification

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>

* feat: Display error if no [...nextauth].js found (#678)

* Display error if no [...nextauth].js found

fixes #647

* Log the error and describe it inside errors.md

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

* chore(deps): Bump ini from 1.3.5 to 1.3.8 in /www (#953)

Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: fix typo Adapater -> Adapter (#960)

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>

* docs: We have twice the word "side" (#964)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a7af.

* chore: add myself to the contributors list 🙈

* We have twice the word "side"

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>

* docs: Correcting a typo. "available" Line 70 (#965)

* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a7af.

* chore: add myself to the contributors list 🙈

* Correcting a typo. "available" Line 70

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>

* chore: hide comments from pull request template

* Update README.md

Updated the readme to include the projects logo, fixed some typos, and added license info and contributor image.

* feat: add strava provider (#986)

* Add Strava as a provider

* Add documentation for Strava provider

* Fix lint errors

Co-authored-by: Paul Kenneth Kent <paul@ventureharbour.com>

* Update README.md

* Update README.md

* feat: add semantic-release (#920)

* chore(release): change semantic-release/git to semantic-release/github

* docs(database): add mssql indexes in docs, fix typos (#925)

* added mssql indexes in docs, fixed typo

* docs: fix typo in www/docs/schemas/mssql.md

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

* chore(release): delete old workflow

* chore(release): trigger release on docs type

* fix: treat user.id as optional param (#1010)

* fix(adapter): use findOne for typeorm (#1014)

* Change image to text from varchar (#777)

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

* feat(db): make Fauna DB collections & indexes configurable (#968)

* Add collections & indexes overrides for Fauna DB

* Fix the name of the verification token index

Co-authored-by: Florian Michaut <florian@coding-days.com>

* docs: Remove unnecessary promises (#915)

* feat: allow to return string in signIn callback (#1019)

* docs: small update to sign in/out examples (#1016)

* Update examples in client.md

* Update more examples

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

* docs: update contributing information [skip release] (#1011)

* docs: update CONTRIBUTING.md

* docs:  use db instead of database for more space

* docs: update CONTRIBUTING.md

* docs: update PR template

* docs: add note about skipping a release

* docs: fix typos in CONTRIBUTING.md [skip release]

* refactor: code base improvements (#959)

* chore: fix casing of OAuth

* refacotr: simplify default callbacks lib file

* refactor: use native URL instead of string concats

* refactor: move redirect to res.redirect, done to res.end

* refactor: move options to req

* refactor: improve IntelliSense, name all functions

* fix(lint): fix lint errors

* refactor: remove jwt-decode dependency

* refactor: refactor some callbacks to Promises

* revert: "refactor: use native URL instead of string concats"

Refs: 690c55b04089e4f3157424c816d43ee4cecb77a0

* chore: misc changes

Co-authored-by: Balazs Orban <balazs@nhi.no>

* feat(provider): Add Mail.ru OAuth Service Provider and Callback snippet (#522)

* Update callback.js

- Fix Mail.ru bug (missing request parameter: access_token)

Note: setGetAccessTokenProfileUrl should be added to Mail.ru provider to enable support.

* Add Mail.ru OAuth Service Provider

* Update callbacks.md

- Fix broken callbacks snippet.

* Update callback.js

- Bug fix https://github.com/nextauthjs/next-auth/pull/522#issuecomment-669851914
- Minor refactoring.

* Fix: Code linting.

* Update callback.js

Improve approach for building of URL based review recommendation.

* Feat: Reduce API surface expansion

Make use of provider.id === "mailru" as suggested in review discussion in place of setGetAccessTokenProfileUrl.

* Fix: Code linting

* feat: forward id_token to jwt and signIn callbacks (#1024)

* chore: add auto labeling to PRs [skip release] (#1025)

* chore: add auto labeling to PRs [skip release]

* chore: allow any file type for test label to be added

* chore: rename labeler.yaml to labeler.yml [skip release]

* fix: miscellaneous bugfixes (#1030)

* fix: use named params to fix order

* fix: avoid recursive redirects

* fix: revert to use parsed baseUrl

* fix: avoid recursive res.end calls

* fix: use named params in renderPage

* fix: promisify lib/oauth/callback result

* fix: don't chain on res.end on non-chainable res methods (#1031)

* docs: add powered by vercel logo [skip release]

* chore: run tests on canary [skip release]

* docs: misc improvements [skip release] (#1043)

* refactor: code base improvements 2 (#1045)

* fix: trigger release

* fix: use authorizationUrl correctly

* feat(provider): reduce user facing API (#1023)

Co-authored-by: Balazs Orban <balazs@nhi.no>

* fix: remove async from NextAuth default handler

This function should not return a Promise

* feat(provider): add vk.com provider (#1060)

* feat(provider): add vk.com provider

* refactor(provider): reduce vk.com provider api

* refactor: code base improvements 3 (#1072)

* refactor: extend res.{end,send,json}, redirect

* refactor: chain res methods, remove unnecessary ones

* refactor: simplify oauth callback signature

* refactor: code simplifications

* refactor: re-export everything from routes in one

* refactor: split up main index.js to multiple files

* refactor: simplify passing of provider(s) around

* refactor: extend req with callbackUrl inline

* refactor: simplify page rendering

* refactor: move error page redirects to main file, simplify renderer

* refactor: inline req.options definition

* refactor: simplify error fallbacks

* refactor: remove else branches and unnecessary try..catch

* refactor: add docs, and simplify jwt functions

* refactor: prefer errors object over switch..case in signin page

* feat: log all params sent to logger instead of only first

* refactor: fewer lines input validation

* refactor: remove even more unnecessary else branches

* feat: improve package development experience (#1064)

* chore(deps): add next and react to dev dependencies

* chore: move build configs to avoid crash with next dev

* chore: add next js dev app

* chore: remove .txt extension from LICENSE file

* chore: update CONTRIBUTING.md

* chore: watch css under development

* style(lint): run linter on index.css

* chore: fix some imports for dev server

* refactor: simplify client code

* chore: mention VSCode extension for linting

* docs: reword CONTRIBUTING.md

* chore: ignore linting pages and components

* fix: pass csrfToken to signin renderer

* feat: replace blur/focus event to visibility API for getSession (#1081)

* docs: clarify .env usage in CONTRIBUTING.md [skip release] (#1085)

* docs: improve FAQ docs [skip release]

* chore: update caiuse-lite db

* docs: update  some urls in the docs [skip release]

* feat(pages): add dark theme support (#1088)

* feat(pages): add dark theme support

* docs: document theme option

* chore: remove ts-check from dev app

* style(pages): fix some text colors in dark mode

* feat(provider): add LINE provider (#1091)

* refactor: be explicit about path in jsonconfig [skip release]

* refactor: show signin page in dev app [skip release]

* fix: export getSession [skip release]

somehow the default export does not work in the dev app

* style: make p system theme aware [skip release]

* feat(provider): finish Reddit provider and add documentation (#1094)

* Create reddit.md

* uncommented profile callback

* Update reddit.md

* fix lint issues

* added reddit provider

* added reddit provider

* Add Reddit Provider

For some reason a bunch of providers got deleted in the last commit

* Add Reddit Provider

* Add Reddit Provider

* chore: define providers in single file for docs [skip release]

* chore: Comply to Vercel Open Source sponsorship [skip release] (#1087)

* added banner

* Changed banner image allignment

* changed location of banner again

* added to acknowledgement

* added to acknowledgement 1

* changed image size

* k

* l

* s

* s

* .

* added link to the banner in readme.md

* fixed image redirect

* fixed image allignment

* made changes in readme and index.js

* Changed the source of the banner image

* added banner to the footer of the site

* chore: fix lint issues [skip release]

* feat: add native hkdf (#1124)

* feat: add native hkdf

* feat: import only needed to do hkdf

* feat: tweak digest and arguments

* chore(deps): upgrade typeorm to v0.2.30 (#1145)

* docs: remove v1 documentation (#1142)

* chore(adapters): remove fauna (#1148)

* feat: forward signIn auth params to /authorize (#1149)

* refactor: authorisation -> authorization

* feat: forward authorizationParams from signIn function

* refactor: take auth params as third argument

* docs: document signIn authorizationParams

* fix(adapter): fix ISO Datetime type error in Prisma updateSession (#640)

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>

* feat(provider): add option to generate email verification token (#541)

* Add option to generate email verification token

* chore: remove unused import

* refactor: define default generateVerificationToken in-place

* refactor: define default generateVerificationToken in-place

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>

* docs: update info about TypeScript [skip release]

* feat: add PKCE support (#941)

* chore(deps): upgrade dependencies

* chore(deps): add pkce-challenge

* feat(pkce): initial implementation of PCKE support

* chore: remove URLSearchParams

* chore(deps): upgrade lockfile

* refactor: store code_verifier in a cookie

* refactor: add pkce handlers

* docs: add PKCE documentation

* chore: remove unused param

* chore: revert unnecessary code change

* fix: correct variable names

* fix: correct logger import

* feat(provider): add Salesforce provider (#1027)

* docs(provider): add Salesforce provider

* fix(provider): use authed_user on slack instead of spotify (#1174)

* fix: use startsWith for protocol matching in parseUrl

closes #842

* fix: fix lint issues

* docs: clear things up around using access_token [skip release]

#1078

* docs: fix typo in callbacks.md [skip release]

* chore(provider): remove Mixer (#1178)

"Thank you to our amazing community and Partners.
As of July 22, the Mixer service has closed."

* feat(provider): re-add state, expand protection provider options  (#1184)

* refactor: move OAuthCallbackError to errors file

* refactor: improve pkce handling

* feat(provider): re-introduce state to provider options

* docs(provider): mention protection options "state" and "none"

* docs(provider): document state property deprecation

* fix: only add code_verifier param if protection is pkce

* docs: explain state deprecation better

* chore: unify string

* fix: send /authorize params through url

* fix: Add a null check to the window 'storage' event listener (#1198)

* Add a null check to the window 'storage' event listener

While testing in Cypress it's possible to receive a null value on Storage Events when 'clear' is called and will cause errors as seen in #1125.

* Update index.js

typo

* Update src/client/index.js

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

* formatting

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

* docs(provider): fix typos in providers code snippets [skip release] (#1204)

* docs(adapter): add adapter repo to documentation [skip release] (#1173)

* docs(adapter): add adapter repo to documentation

* docs(adapter): elaborate on custom repo

* fix: forward second argument to fetch body in signIn

fixes #1206

* docs: Fix grammar in "Feature Requests" section of FAQs [skip release] (#1212)

* refactor: provide raw idToken through account object (#1211)

* refactor: provide raw idToken through account object

* docs: clear up accessToken naming

* refactor: provide raw token response to account

* chore: fix grammar in comments

* feat: send all params to logger function (#1214)

* feat(provider): Add Medium (#1213)

* fix: leave accessTokenExpires as null

Forwarding expires_in as is to accessTokenExpires has shown to cause issues with Prisma, and maybe with other flows as well. Setting it back to `null` for now. We still forward `expires_in`, so users can use it if they want to.

Fixes #1216

* docs: more emphasis on req methods [skip release]

* docs: remove announcement bar [skip release]

* fix: make OAuth 1 work after refactoring (#1218)

* chore: add twitter provider to dev app

* feat: bind client instance to overriden methods

* fix: don't add extra params to getOAuthRequestToken

* chore: add twitter to env example, add secret gen instructions

* docs: Update Providers.Credential Example Block [skip release] (#1225)

Closing curly bracket where it should have been a square bracket.

* feat(provider): option to disable client-side redirects (credentials) (#1219)

* chore: add credentials provider to dev app

* feat: add redirect option to signIn, signOut

* feat: set correct status codes for credentials errors

* chore: add credentials page to dev app

* fix: support any provider name for credentials

* feat(ts): preliminary TypeScript support (#1223)

* chore: replace standard with ts-standard

* feat(ts): add some initial types

* feat(ts): import and use types

* chore: allow global fetch through package.json

* chore: upgrade lint scripts to use ts-standard

* chore: run linter on dev app

* chore(ts): satisfy dev Next.js server for TS

* fix: add eslint as dev dependency

* fix(lint): ignore next-env.d.ts from linting

* feat(ts): improve cookies options types

* fix: run linter with fix

* feat(provider): add EVE Online provider (#1227)

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

* Adding EVEOnline provider

Co-authored-by: Gerald McNicholl <gerald.mcnicholl@xero.com>

* docs: clarify custom pages usage [skip release] (#1239)

* docs(provider): Update Atlassian docs (#1255)

* docs: Update Atlassian docs [skip release]

* Update atlassian.md

* fix(provider): okta client authentication (#1257)

* fix: okta client authentication

* chore: run lint fix

* Update pages/api/auth/[...nextauth].js

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

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

* chore: don't sync labels with labeler [skip release]

manually added PR labels were constantly removed on new commits/builds, this hopefully fixes that

* fix(provider): add verificationRequest flag to email signIn callback (#1258)

* fix(ui): use color text var for input color (#1260)

Co-authored-by: Archit Khode <archit.khode@gmail.com>

* docs: Minor text error fixed [skip release] (#1263)

* feat(provider): update session when signIn/signOut successful (#1267)

* feat(provider): update session when login/logout successful

* chore: remove manual page reload from dev app

* docs(client): document redirect: false

* fix(page): fix typo in error page

* Merge pull request from GHSA-pg53-56cg-4m8q

* fix(adapter): Verify identifier as well as token in Prisma adapter

* feat(adapter): Improve typeorm adapter

Improve conditional check in TypeORM adapter.

This should have no impact in practice but sets  a good example.

* docs(adapter): Update Prisma docs [skip release] (#1279) (#1283)

Co-authored-by: Iain Collins <me@iaincollins.com>

* docs(provider): Update azure-ad-b2c.md [skip release] (#1280)

* docs(adapter): Update Prisma docs (#1279)

* Update azure-ad-b2c.md

add hint for redirection URL, otherwise difficult to find out

* Update azure-ad-b2c.md

changed .env ro .env.local as per recommendation

* Update azure-ad-b2c.md

* Update azure-ad-b2c.md

* Update azure-ad-b2c.md

* update conf in .env.local 

follow the .env guidelines

* Update azure-ad-b2c.md

* Create azure-ad-b2c.md

* Create azure-ad-b2c.md

* Update azure-ad-b2c.md

Co-authored-by: Iain Collins <me@iaincollins.com>

* docs: Change "docs" to "documentation"

* fix(provider): Fixes for email sign in (#1285)

* fix(adapter): Fix Prisma delete

Must use Prsima deleteMany() instead of delete() with multiple clauses.

* feat: Update example project

Update example project to make it easier to test with database adapters.

* fix(ui): Fix message text in light / auto theme

Info message text is always on the same background (blue) on both themes so should always be white.

* docs: Update example .env [skip release]

* feat: Update Prisma peerOptionalDependencies

* docs: trigger release

Co-authored-by: Luke Lau <luke_lau@icloud.com>
Co-authored-by: James Perkins <jamesperkins@hey.com>
Co-authored-by: Joshua K. Martinez <joshkmartinez@gmail.com>
Co-authored-by: Pauldic <Pauldiconline@yahoo.com>
Co-authored-by: Josh Padnick <josh@gruntwork.io>
Co-authored-by: Daggy1234 <arnav.jindal7@gmail.com>
Co-authored-by: Alan Ray <71240883+ohheyalanray@users.noreply.github.com>
Co-authored-by: Manish Chiniwalar <manishrc@users.noreply.github.com>
Co-authored-by: Aymeric <34040599+afoyer@users.noreply.github.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Fabrizio Ruggeri <ramiel@users.noreply.github.com>
Co-authored-by: Iain Collins <me@iaincollins.com>
Co-authored-by: Joseph Vaughan <Joev-@users.noreply.github.com>
Co-authored-by: Joost Jansky <styxlab@users.noreply.github.com>
Co-authored-by: styxlab <cws@DE01WP777.scdom.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: RobertCraigie <robertcraigie30@gmail.com>
Co-authored-by: Joe Bell <joe@joebell.co.uk>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>
Co-authored-by: Cathy Chen <cathykaichen@gmail.com>
Co-authored-by: Kristóf Poduszló <kripod@protonmail.com>
Co-authored-by: Haldun Anil <haldunanil@users.noreply.github.com>
Co-authored-by: Jakub Naskręski <36169811+kleyu@users.noreply.github.com>
Co-authored-by: imgregduh <imgregorywong@gmail.com>
Co-authored-by: pkabore <paulkabore333@gmail.com>
Co-authored-by: Paul Kenneth Kent <pkennethkent@gmail.com>
Co-authored-by: Paul Kenneth Kent <paul@ventureharbour.com>
Co-authored-by: Balazs Orban <balazs@nhi.no>
Co-authored-by: Junior Vidotti <jrvidotti@gmail.com>
Co-authored-by: Yuma Matsune <yuma.matsune@gmail.com>
Co-authored-by: Ben West <Xodarap@users.noreply.github.com>
Co-authored-by: Florian Michaut <florianmichaut@gmail.com>
Co-authored-by: Florian Michaut <florian@coding-days.com>
Co-authored-by: Melanie Seltzer <melleh11@gmail.com>
Co-authored-by: Didi Keke <nyedidikeke@users.noreply.github.com>
Co-authored-by: Evgeniy Boreyko <boreykojenya@yandex.ru>
Co-authored-by: Alex B <lnikell@gmail.com>
Co-authored-by: Ben <5271788+bebax@users.noreply.github.com>
Co-authored-by: suraj10k <63460026+suraj10k@users.noreply.github.com>
Co-authored-by: t.kuriyama <koolii0909@gmail.com>
Co-authored-by: Yuri Gor <YuriGor@users.noreply.github.com>
Co-authored-by: Radhika <56536997+96RadhikaJadhav@users.noreply.github.com>
Co-authored-by: Henrik Wenz <HaNdTriX@users.noreply.github.com>
Co-authored-by: Zhao Lei <firede@firede.com>
Co-authored-by: Mohamed El Mahallawy <mmahalwy@gmail.com>
Co-authored-by: Dillon Mulroy <dillon.mulroy@gmail.com>
Co-authored-by: Carmelo Scandaliato <8927157+cascandaliato@users.noreply.github.com>
Co-authored-by: Aishah <aissshah@outlook.com>
Co-authored-by: Samson Zhang <wwsamson@yahoo.com>
Co-authored-by: Vova <volodimir.partytskyi@gmail.com>
Co-authored-by: Cody Ogden <cody@codyogden.com>
Co-authored-by: geraldm74 <gerald_mcnicholl@yahoo.com>
Co-authored-by: Gerald McNicholl <gerald.mcnicholl@xero.com>
Co-authored-by: Jeremy Caine <jezcaine@gmail.com>
Co-authored-by: Matthew Graser <mdgraser@gmail.com>
Co-authored-by: mgraser <matt.graser@mlb.com>
Co-authored-by: Kristofor Carle <kris@maphubs.com>
Co-authored-by: Archit Khode <arkits@outlook.com>
Co-authored-by: Archit Khode <archit.khode@gmail.com>
Co-authored-by: Daniel Gadd <danielgadd@outlook.com>
Co-authored-by: Robert Hufsky <Robert.Hufsky@gmx.net>
2021-02-09 15:47:47 +01:00
Iain Collins
6af40e3fe2 docs(adapter): Update Prisma docs (#1279) 2021-02-08 19:30:32 +00:00
Cody Ogden
cdc1ac52b2 docs: Update Providers.Credential Example Block [skip release] (#1225)
Closing curly bracket where it should have been a square bracket.
2021-02-01 10:01:10 +01:00
Balázs Orbán
f2a7ee0b34 fix: make OAuth 1 work after refactoring (#1218)
* chore: add twitter provider to dev app

* feat: bind client instance to overriden methods

* fix: don't add extra params to getOAuthRequestToken

* chore: add twitter to env example, add secret gen instructions
2021-02-01 10:01:10 +01:00
Balázs Orbán
d67f1b7718 docs: remove announcement bar [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
396f5d8bbc docs: more emphasis on req methods [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
d7e78d5996 fix: leave accessTokenExpires as null
Forwarding expires_in as is to accessTokenExpires has shown to cause issues with Prisma, and maybe with other flows as well. Setting it back to `null` for now. We still forward `expires_in`, so users can use it if they want to.

Fixes #1216
2021-02-01 10:01:10 +01:00
Vova
ad3b0b6a7d feat(provider): Add Medium (#1213) 2021-02-01 10:01:10 +01:00
Balázs Orbán
f4a954ccbb feat: send all params to logger function (#1214) 2021-02-01 10:01:10 +01:00
Balázs Orbán
93f051ce08 refactor: provide raw idToken through account object (#1211)
* refactor: provide raw idToken through account object

* docs: clear up accessToken naming

* refactor: provide raw token response to account

* chore: fix grammar in comments
2021-02-01 10:01:10 +01:00
Samson Zhang
645b53ee49 docs: Fix grammar in "Feature Requests" section of FAQs [skip release] (#1212) 2021-02-01 10:01:10 +01:00
Balázs Orbán
9c9744f30a fix: forward second argument to fetch body in signIn
fixes #1206
2021-02-01 10:01:10 +01:00
Aishah
9860ad8c8c docs(adapter): add adapter repo to documentation [skip release] (#1173)
* docs(adapter): add adapter repo to documentation

* docs(adapter): elaborate on custom repo
2021-02-01 10:01:10 +01:00
Carmelo Scandaliato
23ada52f97 docs(provider): fix typos in providers code snippets [skip release] (#1204) 2021-02-01 10:01:10 +01:00
Dillon Mulroy
65e4910618 fix: Add a null check to the window 'storage' event listener (#1198)
* Add a null check to the window 'storage' event listener

While testing in Cypress it's possible to receive a null value on Storage Events when 'clear' is called and will cause errors as seen in #1125.

* Update index.js

typo

* Update src/client/index.js

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

* formatting

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Balázs Orbán
30c6d6360f fix: send /authorize params through url 2021-02-01 10:01:10 +01:00
Balázs Orbán
214b22ecbb feat(provider): re-add state, expand protection provider options (#1184)
* refactor: move OAuthCallbackError to errors file

* refactor: improve pkce handling

* feat(provider): re-introduce state to provider options

* docs(provider): mention protection options "state" and "none"

* docs(provider): document state property deprecation

* fix: only add code_verifier param if protection is pkce

* docs: explain state deprecation better

* chore: unify string
2021-02-01 10:01:10 +01:00
Balázs Orbán
f50ac194aa chore(provider): remove Mixer (#1178)
"Thank you to our amazing community and Partners.
As of July 22, the Mixer service has closed."
2021-02-01 10:01:10 +01:00
Balázs Orbán
b40e1441ec docs: fix typo in callbacks.md [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
90a8f7c890 docs: clear things up around using access_token [skip release]
#1078
2021-02-01 10:01:10 +01:00
Balázs Orbán
a7bae0395b fix: fix lint issues 2021-02-01 10:01:10 +01:00
Balázs Orbán
71b3122fd1 fix: use startsWith for protocol matching in parseUrl
closes #842
2021-02-01 10:01:10 +01:00
Luke Lau
1caa9bb813 fix(provider): use authed_user on slack instead of spotify (#1174) 2021-02-01 10:01:10 +01:00
Balázs Orbán
daed68aee2 docs(provider): add Salesforce provider 2021-02-01 10:01:10 +01:00
Mohamed El Mahallawy
2f3ed7507b feat(provider): add Salesforce provider (#1027) 2021-02-01 10:01:10 +01:00
Balázs Orbán
a15bdc191b fix: correct logger import 2021-02-01 10:01:10 +01:00
Balázs Orbán
ea71a1fb2f feat: add PKCE support (#941)
* chore(deps): upgrade dependencies

* chore(deps): add pkce-challenge

* feat(pkce): initial implementation of PCKE support

* chore: remove URLSearchParams

* chore(deps): upgrade lockfile

* refactor: store code_verifier in a cookie

* refactor: add pkce handlers

* docs: add PKCE documentation

* chore: remove unused param

* chore: revert unnecessary code change

* fix: correct variable names
2021-02-01 10:01:10 +01:00
Balázs Orbán
0069095bce docs: update info about TypeScript [skip release] 2021-02-01 10:01:10 +01:00
Zhao Lei
42a822c407 feat(provider): add option to generate email verification token (#541)
* Add option to generate email verification token

* chore: remove unused import

* refactor: define default generateVerificationToken in-place

* refactor: define default generateVerificationToken in-place

Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Henrik Wenz
2cfe5ad879 fix(adapter): fix ISO Datetime type error in Prisma updateSession (#640)
Co-authored-by: Nico Domino <yo@ndo.dev>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Balázs Orbán
cba149f4b6 feat: forward signIn auth params to /authorize (#1149)
* refactor: authorisation -> authorization

* feat: forward authorizationParams from signIn function

* refactor: take auth params as third argument

* docs: document signIn authorizationParams
2021-02-01 10:01:10 +01:00
Balázs Orbán
31bb2c342c chore(adapters): remove fauna (#1148) 2021-02-01 10:01:10 +01:00
Radhika
af30be1fa4 docs: remove v1 documentation (#1142) 2021-02-01 10:01:10 +01:00
Yuri Gor
ebaa28f04e chore(deps): upgrade typeorm to v0.2.30 (#1145) 2021-02-01 10:01:10 +01:00
t.kuriyama
e26297b901 feat: add native hkdf (#1124)
* feat: add native hkdf

* feat: import only needed to do hkdf

* feat: tweak digest and arguments
2021-02-01 10:01:10 +01:00
Balázs Orbán
2562b3c5d8 chore: fix lint issues [skip release] 2021-02-01 10:01:10 +01:00
suraj10k
f8e5a79ce1 chore: Comply to Vercel Open Source sponsorship [skip release] (#1087)
* added banner

* Changed banner image allignment

* changed location of banner again

* added to acknowledgement

* added to acknowledgement 1

* changed image size

* k

* l

* s

* s

* .

* added link to the banner in readme.md

* fixed image redirect

* fixed image allignment

* made changes in readme and index.js

* Changed the source of the banner image

* added banner to the footer of the site
2021-02-01 10:01:10 +01:00
Balázs Orbán
be53ef0f71 chore: define providers in single file for docs [skip release] 2021-02-01 10:01:10 +01:00
Aymeric
fbb5a12cbd feat(provider): finish Reddit provider and add documentation (#1094)
* Create reddit.md

* uncommented profile callback

* Update reddit.md

* fix lint issues

* added reddit provider

* added reddit provider

* Add Reddit Provider

For some reason a bunch of providers got deleted in the last commit

* Add Reddit Provider

* Add Reddit Provider
2021-02-01 10:01:10 +01:00
Balázs Orbán
70a186c183 style: make p system theme aware [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
cff9d3e294 fix: export getSession [skip release]
somehow the default export does not work in the dev app
2021-02-01 10:01:10 +01:00
Balázs Orbán
2865b8cc2d refactor: show signin page in dev app [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
b84f1b681c refactor: be explicit about path in jsonconfig [skip release] 2021-02-01 10:01:10 +01:00
Ben
ea1d09bf83 feat(provider): add LINE provider (#1091) 2021-02-01 10:01:10 +01:00
Balázs Orbán
a18ec09307 feat(pages): add dark theme support (#1088)
* feat(pages): add dark theme support

* docs: document theme option

* chore: remove ts-check from dev app

* style(pages): fix some text colors in dark mode
2021-02-01 10:01:10 +01:00
Balázs Orbán
37cb81094f docs: update some urls in the docs [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
040d7c5017 chore: update caiuse-lite db 2021-02-01 10:01:10 +01:00
Balázs Orbán
f53ea6c9a9 docs: improve FAQ docs [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
7f670c5222 docs: clarify .env usage in CONTRIBUTING.md [skip release] (#1085) 2021-02-01 10:01:10 +01:00
Alex B
b1a99ec32f feat: replace blur/focus event to visibility API for getSession (#1081) 2021-02-01 10:01:10 +01:00
Balázs Orbán
ca065604a3 fix: pass csrfToken to signin renderer 2021-02-01 10:01:10 +01:00
Balázs Orbán
77de2abd14 feat: improve package development experience (#1064)
* chore(deps): add next and react to dev dependencies

* chore: move build configs to avoid crash with next dev

* chore: add next js dev app

* chore: remove .txt extension from LICENSE file

* chore: update CONTRIBUTING.md

* chore: watch css under development

* style(lint): run linter on index.css

* chore: fix some imports for dev server

* refactor: simplify client code

* chore: mention VSCode extension for linting

* docs: reword CONTRIBUTING.md

* chore: ignore linting pages and components
2021-02-01 10:01:10 +01:00
Balázs Orbán
f6d6c4344c refactor: code base improvements 3 (#1072)
* refactor: extend res.{end,send,json}, redirect

* refactor: chain res methods, remove unnecessary ones

* refactor: simplify oauth callback signature

* refactor: code simplifications

* refactor: re-export everything from routes in one

* refactor: split up main index.js to multiple files

* refactor: simplify passing of provider(s) around

* refactor: extend req with callbackUrl inline

* refactor: simplify page rendering

* refactor: move error page redirects to main file, simplify renderer

* refactor: inline req.options definition

* refactor: simplify error fallbacks

* refactor: remove else branches and unnecessary try..catch

* refactor: add docs, and simplify jwt functions

* refactor: prefer errors object over switch..case in signin page

* feat: log all params sent to logger instead of only first

* refactor: fewer lines input validation

* refactor: remove even more unnecessary else branches
2021-02-01 10:01:10 +01:00
Evgeniy Boreyko
e8b1513899 feat(provider): add vk.com provider (#1060)
* feat(provider): add vk.com provider

* refactor(provider): reduce vk.com provider api
2021-02-01 10:01:10 +01:00
Balázs Orbán
505efc8a5d fix: remove async from NextAuth default handler
This function should not return a Promise
2021-02-01 10:01:10 +01:00
Balázs Orbán
76b983229a feat(provider): reduce user facing API (#1023)
Co-authored-by: Balazs Orban <balazs@nhi.no>
2021-02-01 10:01:10 +01:00
Balázs Orbán
ecddaf696b fix: use authorizationUrl correctly 2021-02-01 10:01:10 +01:00
Balázs Orbán
b43e7dca43 fix: trigger release 2021-02-01 10:01:10 +01:00
Balázs Orbán
e7c34fd74b refactor: code base improvements 2 (#1045) 2021-02-01 10:01:10 +01:00
Balázs Orbán
e0dd8e400b docs: misc improvements [skip release] (#1043) 2021-02-01 10:01:10 +01:00
Balázs Orbán
21d22a7e08 chore: run tests on canary [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
cb2fe0cae6 docs: add powered by vercel logo [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
9ed75c7788 fix: don't chain on res.end on non-chainable res methods (#1031) 2021-02-01 10:01:10 +01:00
Balázs Orbán
8e8713755a fix: miscellaneous bugfixes (#1030)
* fix: use named params to fix order

* fix: avoid recursive redirects

* fix: revert to use parsed baseUrl

* fix: avoid recursive res.end calls

* fix: use named params in renderPage

* fix: promisify lib/oauth/callback result
2021-02-01 10:01:10 +01:00
Balázs Orbán
7fdde6268e chore: rename labeler.yaml to labeler.yml [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
5e949a3b97 chore: add auto labeling to PRs [skip release] (#1025)
* chore: add auto labeling to PRs [skip release]

* chore: allow any file type for test label to be added
2021-02-01 10:01:10 +01:00
Balázs Orbán
a979e040cd feat: forward id_token to jwt and signIn callbacks (#1024) 2021-02-01 10:01:10 +01:00
Didi Keke
2205cfa754 feat(provider): Add Mail.ru OAuth Service Provider and Callback snippet (#522)
* Update callback.js

- Fix Mail.ru bug (missing request parameter: access_token)

Note: setGetAccessTokenProfileUrl should be added to Mail.ru provider to enable support.

* Add Mail.ru OAuth Service Provider

* Update callbacks.md

- Fix broken callbacks snippet.

* Update callback.js

- Bug fix https://github.com/nextauthjs/next-auth/pull/522#issuecomment-669851914
- Minor refactoring.

* Fix: Code linting.

* Update callback.js

Improve approach for building of URL based review recommendation.

* Feat: Reduce API surface expansion

Make use of provider.id === "mailru" as suggested in review discussion in place of setGetAccessTokenProfileUrl.

* Fix: Code linting
2021-02-01 10:01:10 +01:00
Balázs Orbán
0989ef6171 refactor: code base improvements (#959)
* chore: fix casing of OAuth

* refacotr: simplify default callbacks lib file

* refactor: use native URL instead of string concats

* refactor: move redirect to res.redirect, done to res.end

* refactor: move options to req

* refactor: improve IntelliSense, name all functions

* fix(lint): fix lint errors

* refactor: remove jwt-decode dependency

* refactor: refactor some callbacks to Promises

* revert: "refactor: use native URL instead of string concats"

Refs: 690c55b04089e4f3157424c816d43ee4cecb77a0

* chore: misc changes

Co-authored-by: Balazs Orban <balazs@nhi.no>
2021-02-01 10:01:10 +01:00
Balázs Orbán
7979b1069e docs: fix typos in CONTRIBUTING.md [skip release] 2021-02-01 10:01:10 +01:00
Balázs Orbán
71b50082f8 docs: update contributing information [skip release] (#1011)
* docs: update CONTRIBUTING.md

* docs:  use db instead of database for more space

* docs: update CONTRIBUTING.md

* docs: update PR template

* docs: add note about skipping a release
2021-02-01 10:01:10 +01:00
Melanie Seltzer
f3cc4d1018 docs: small update to sign in/out examples (#1016)
* Update examples in client.md

* Update more examples

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Balázs Orbán
15570b7479 feat: allow to return string in signIn callback (#1019) 2021-02-01 10:01:10 +01:00
Balázs Orbán
a5187b69e8 docs: Remove unnecessary promises (#915) 2021-02-01 10:01:10 +01:00
Florian Michaut
751fd7bb0e feat(db): make Fauna DB collections & indexes configurable (#968)
* Add collections & indexes overrides for Fauna DB

* Fix the name of the verification token index

Co-authored-by: Florian Michaut <florian@coding-days.com>
2021-02-01 10:01:10 +01:00
Ben West
94054db3f3 Change image to text from varchar (#777)
Co-authored-by: Nico Domino <yo@ndo.dev>
2021-02-01 10:01:10 +01:00
Yuma Matsune
f93dbbbfee fix(adapter): use findOne for typeorm (#1014) 2021-02-01 10:01:10 +01:00
Balázs Orbán
e3fd0ad450 fix: treat user.id as optional param (#1010) 2021-02-01 10:01:10 +01:00
Balázs Orbán
e06816a374 chore(release): trigger release on docs type 2021-02-01 10:01:10 +01:00
Balázs Orbán
284118e708 chore(release): delete old workflow 2021-02-01 10:01:10 +01:00
Junior Vidotti
84bcecbec1 docs(database): add mssql indexes in docs, fix typos (#925)
* added mssql indexes in docs, fixed typo

* docs: fix typo in www/docs/schemas/mssql.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Balazs Orban
5060bd7f9b chore(release): change semantic-release/git to semantic-release/github 2021-02-01 10:01:10 +01:00
Balázs Orbán
16a8720b1d feat: add semantic-release (#920) 2021-02-01 10:01:10 +01:00
Nico Domino
3c056d7ff5 Update README.md 2021-02-01 10:01:10 +01:00
Nico Domino
49dd7a807d Update README.md 2021-02-01 10:01:10 +01:00
Paul Kenneth Kent
42596fbca5 feat: add strava provider (#986)
* Add Strava as a provider

* Add documentation for Strava provider

* Fix lint errors

Co-authored-by: Paul Kenneth Kent <paul@ventureharbour.com>
2021-02-01 10:01:10 +01:00
Nico Domino
68d0f9465a Update README.md
Updated the readme to include the projects logo, fixed some typos, and added license info and contributor image.
2021-02-01 10:01:10 +01:00
Balázs Orbán
71b4af0894 chore: hide comments from pull request template 2021-02-01 10:01:10 +01:00
pkabore
8bbb0ec344 docs: Correcting a typo. "available" Line 70 (#965)
* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a7af.

* chore: add myself to the contributors list 🙈

* Correcting a typo. "available" Line 70

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>
2021-02-01 10:01:10 +01:00
pkabore
b2770d5a1f docs: We have twice the word "side" (#964)
* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a7af.

* chore: add myself to the contributors list 🙈

* We have twice the word "side"

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>
2021-02-01 10:01:10 +01:00
imgregduh
192e5bf07e docs: fix typo Adapater -> Adapter (#960)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>
2021-02-01 10:01:10 +01:00
dependabot[bot]
9abdbb57eb chore(deps): Bump ini from 1.3.5 to 1.3.8 in /www (#953)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-01 10:01:10 +01:00
Jakub Naskręski
989d23e827 feat: Display error if no [...nextauth].js found (#678)
* Display error if no [...nextauth].js found

fixes #647

* Log the error and describe it inside errors.md

Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Haldun Anil
025f33a91f docs: fix incorrect references in cypress docs (#932)
* chore: use stale label, instead of wontfix

* chore: add link to issue explaining stalebot

* chore: fix typo in stalebot comment

* chore: run build GitHub Action on canary also

* chore: run build GitHub Actions on canary as well

* chore: add reproduction section to questions

* feat(provider): Add Azure Active Directory B2C (#809)

* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)

This reverts commit 6e6a24a7af.

* chore: add myself to the contributors list 🙈

* docs: fix incorrect references in cypress docs

* chore: add additional docs clarification

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Vladimir Evdokimov <evdokimov.vladimir@gmail.com>
2021-02-01 10:01:10 +01:00
Luke Lau
6e2fc11d64 feat: Store user ID in sub claim of default JWT (#784)
This allows us to check if the user is signed in when using JWTs

Part of #625
2021-02-01 10:01:10 +01:00
Balázs Orbán
6b1b8613d0 chore: reword PR template 2021-02-01 10:01:10 +01:00
Balázs Orbán
6d023aa533 chore: create PULL_REQUEST_TEMPLATE.md 2021-02-01 10:01:10 +01:00
Balázs Orbán
080dd5f569 chore: add note about conveting questions to discussions 2021-02-01 10:01:10 +01:00
Balázs Orbán
a6867b3564 chore: disallow issues without template 2021-02-01 10:01:10 +01:00
dependabot[bot]
6750accc0a chore(dep): Bump highlight.js from 9.18.1 to 9.18.5 (#880)
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.1 to 9.18.5.
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.18.1...9.18.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2021-02-01 10:01:10 +01:00
Kristóf Poduszló
9aae7bbc54 refactor(db): update Prisma calls to support 2.12+ (#881)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2021-02-01 10:01:10 +01:00
Cathy Chen
a84fe596af update(provider): Update Slack provider to use V2 OAuth endpoints (#895)
* Update Slack to v2 authorize urls, option for additional authorize params
* acessTokenGetter + documentation
2021-02-01 10:01:10 +01:00
Vladimir Evdokimov
18840ead40 feat(provider): Add Azure Active Directory B2C (#921)
* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index

* doc: add provider to FAQ
2021-02-01 10:01:10 +01:00
Joe Bell
f72ee5ec06 feat: add foursquare (#584) 2021-02-01 10:01:10 +01:00
RobertCraigie
958c31a4ee feat(provider): Add Bungie (#589)
* Add Bungie provider

* Use absolute URL for images

* Correct image URL and use consistent formatting

Co-authored-by: Nico Domino <yo@ndo.dev>
2021-02-01 10:01:10 +01:00
dependabot[bot]
f47f5c6c62 Bump next from 9.5.3 to 9.5.4 in /test/docker/app (#759)
Bumps [next](https://github.com/vercel/next.js) from 9.5.3 to 9.5.4.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v9.5.3...v9.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2021-02-01 10:01:10 +01:00
Joost Jansky
d5f5157366 feat(provider): add netlify (#555)
Co-authored-by: styxlab <cws@DE01WP777.scdom.net>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Joseph Vaughan
9fbfd90bb2 add(db): Add support for Fauna DB (#708)
* Add support for Fauna DB

* Add integration tests

Co-authored-by: Nico Domino <yo@ndo.dev>
2021-02-01 10:01:10 +01:00
Fabrizio Ruggeri
97d6f19fab Include callbackUrl in newUser page (#790)
* Include callbackUrl in newUser page

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <me@iaincollins.com>

* Update src/server/routes/callback.js

Co-authored-by: Iain Collins <me@iaincollins.com>

Co-authored-by: Iain Collins <me@iaincollins.com>
Co-authored-by: Nico Domino <yo@ndo.dev>
2021-02-01 10:01:10 +01:00
Nico Domino
fdcc62bd26 WIP: Update Docusaurus + Site dependencies (#802)
* update: deps

* fix: broken link

* fix: search upgrade change
2021-02-01 10:01:10 +01:00
Aymeric
4764d60268 Fix for Reddit Authentication (#866)
* Fixed Reddit Authentication

* updated fix for build test

* updated buffer to avoid deprecation message

* Updated for passing tests
2021-02-01 10:01:10 +01:00
Manish Chiniwalar
5f51c975c9 docs: Update default ports for support Databases (#839)
https://next-auth.js.org/configuration/databases
2021-02-01 10:01:10 +01:00
Balázs Orbán
0c9104c13a fix(provider): handle no profile image for Spotify (#914)
* chore(deps): upgrade "standard"

* style(lint): run lint fix

* fix(provider): optional chain Spotify provider profile img
2021-02-01 10:01:10 +01:00
Alan Ray
8a6f0944ef fix: update Okta routes (#763)
the current routing for the Okta provider does not follow the standard
set by Okta, and as such doesn't allow for custom subdomains. this
update amends the routes to allow for customer subdomains, and also
aligns next-auth with Okta's documentation.
2021-02-01 10:01:10 +01:00
Daggy1234
672cedc712 fix: ensure Images are produced for discord (#734) 2021-02-01 10:01:10 +01:00
Josh Padnick
05b275956b fix: update nodemailer version in response to CVE. (#860)
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7769 reports a high-severity issue with the current version of nodemailer. This should be merged and released right away if possible.
2021-02-01 10:01:10 +01:00
Pauldic
219b01724b docs: fix typo in callbacks.md (#815)
This is a simple typographical error changed accesed to accessed
2021-02-01 10:01:10 +01:00
Joshua K. Martinez
94b0c68c8f docs: fix discord example code (#850) 2021-02-01 10:01:10 +01:00
James Perkins
81ebff897f docs: update for Now to Vercel (#847)
Vercel archived their now packages a while back, so you can use vercel env pull to pull in the .env
2021-02-01 10:01:10 +01:00
Luke Lau
8ac14ed298 feat: allow react 17 as a peer dependency (#819)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2021-02-01 10:01:10 +01:00
Balázs Orbán
51cfec92ba feat: simplify NextAuth instantiation (#911) 2021-02-01 10:01:10 +01:00
Balázs Orbán
78fd783bac docs: announce canary docs [skip release] (#1044) 2021-01-04 23:15:23 +01:00
Balázs Orbán
cec46b0d67 chore: add myself to the contributors list 🙈 2020-12-07 22:33:18 +01:00
Balázs Orbán
7bedd4afa9 Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919)
This reverts commit 6e6a24a7af.
2020-12-06 21:43:13 +01:00
Vladimir Evdokimov
6e6a24a7af feat(provider): Add Azure Active Directory B2C (#809)
* add provider: Microsoft

* documentation

* support no tenant setup

* fix code style

* chore: rename Microsoft provider to AzureADB2C

* chore: alphabetical order in providers/index
2020-12-06 21:34:40 +01:00
Balázs Orbán
6f067be7b0 chore: add reproduction section to questions 2020-12-05 21:40:12 +01:00
Balázs Orbán
e4cc3a92e5 chore: run build GitHub Actions on canary as well 2020-12-05 19:47:09 +01:00
Balázs Orbán
610ab39b40 chore: run build GitHub Action on canary also 2020-12-05 18:53:31 +01:00
Balázs Orbán
7d1168637d chore: fix typo in stalebot comment 2020-12-05 16:30:09 +01:00
Balázs Orbán
b2c1f32057 chore: add link to issue explaining stalebot 2020-12-05 14:19:45 +01:00
Balázs Orbán
9247495fee chore: use stale label, instead of wontfix 2020-12-05 14:15:55 +01:00
Balázs Orbán
341fae28d4 Revert "feat: simplify NextAuth instantiation" (#910)
This reverts commit b86ffa5dd5.
2020-12-05 10:39:03 +01:00
Balázs Orbán
b86ffa5dd5 feat: simplify NextAuth instantiation (#867) 2020-12-05 10:34:32 +01:00
Damien Guard
5415a9c3ab docs: remove redundant 3rd arg to sessions example (#874)
There is no third argument as per 8115a7c66c/src/server/routes/session.js (L82)
2020-12-05 10:15:28 +01:00
sankara
dc516e8be8 docs: fix typo in options.md (#873) 2020-12-05 10:13:43 +01:00
sAy
29a0d9d295 docs: update API docs about server-side getProviders (#879) 2020-12-05 10:12:17 +01:00
Balázs Orbán
5f5174f6e2 refactor: define _getSession in useEffect scope (#724) 2020-12-05 10:00:30 +01:00
Dennis Morello
424b4ee257 Update apple.md
Fixed a typo
2020-12-05 09:57:29 +01:00
Balázs Orbán
545a7e752e feat: forward auth params from signin to provider (#823) 2020-12-05 09:54:27 +01:00
Balázs Orbán
c564b84182 chore: add stalebot configuration 2020-12-05 09:37:27 +01:00
Siddharth Sharma
0db233d208 Add Sign in With Apple Tutorial (#896)
Co-authored-by: Iain Collins <me@iaincollins.com>
2020-12-02 11:13:53 +00:00
Yana Agun Siswanto
5126f4e342 CONTRIBUTING.md: Fix spelling and other issue (#810)
Co-authored-by: Iain Collins <me@iaincollins.com>
2020-10-30 17:09:42 +00:00
Michael McQuade
e09dfc6a7f Change definitively typed to definitely typed (#813) 2020-10-30 17:08:12 +00:00
Iain Collins
ccfa1d55bb Update errors.md 2020-10-30 14:18:25 +00:00
ndom91
d7dc7b0753 add: ndom91 dev.to tutorial 2020-10-27 15:39:30 +01:00
Alex Vilchis
0407e130c4 Fix grammar (#801) 2020-10-27 10:12:07 +00:00
Kristóf Poduszló
64084d634b fix: capitalization of errors in url params (#795) 2020-10-24 01:55:01 +01:00
Iain Collins
438a737837 Update providers.md 2020-10-20 11:54:19 +01:00
Iain Collins
a482a64f10 Update providers.md 2020-10-19 16:29:09 +01:00
Iain Collins
2227d34725 Update documentation (#786)
* Improved homepage and getting started guide
* Improved experience viewing docs on mobile devices
* Fixed typos
2020-10-19 14:19:09 +01:00
Jesus Castro (Tony)
9c6ef951a1 Typo: retuning should be returning
It ain't much but its honest work
2020-10-08 15:45:41 +01:00
Kristóf Poduszló
01c897f23e Correct typo of 'column' in the docs 2020-10-07 07:48:48 +01:00
Kristóf Poduszló
ea65d87d07 Correct tip about adapters in the docs 2020-10-07 07:48:48 +01:00
Kristóf Poduszló
8d1e479d12 Correct mistakenly duplicated word in the docs 2020-10-07 07:48:48 +01:00
Kristóf Poduszló
435b630849 Correct missing word in the docs 2020-10-07 07:48:48 +01:00
Kristóf Poduszló
773c74a756 Correct a typo in the docs 2020-10-07 07:48:48 +01:00
Kristóf Poduszló
6867bc92c8 Correct two typos of the same word in the docs 2020-10-07 07:48:48 +01:00
Kristóf Poduszló
eb6a4c46d9 Correct a typo in the docs 2020-10-06 20:50:28 +01:00
Iain Collins
cd3d2a138b Update tutorials and explainers 2020-10-06 13:50:42 +01:00
Iain Collins
0c356456bb Minor style changes 2020-10-06 13:50:42 +01:00
Iain Collins
6d44a34f7d Reduce image size 2020-10-06 13:50:42 +01:00
Iain Collins
7bda639361 Update branding (icons, homepage) 2020-10-06 13:50:42 +01:00
Francis Udeji
40e453076e Remove arrow syntax
Remove arrow syntax from regular function declaration
2020-10-02 17:34:47 +01:00
Daniel Jahodka
e065552784 Fix missing response_type=code in battlenet
Battle net's /oauth/authorize requires response_type query parameter. For authorization, this must be set to code.
2020-09-30 00:34:00 +01:00
Lluis Agusti
a3104a009c docs(readme): mention Typescript support 2020-09-25 17:38:23 +01:00
Iain Collins
e9eb6bc57e Add conditional to integration test workflow 2020-09-25 17:36:33 +01:00
Blocksmith
95e31b46af Update testing-with-cypress.md (#680)
misspelling depency cypress-social-logins
2020-09-24 13:52:50 +01:00
Jimmy Merritello
d5e70323f0 Update documentation for getProviders 2020-09-24 13:51:29 +01:00
S. Suzuki
4e4d1eac28 Update links to Slack documentation 2020-09-24 13:47:19 +01:00
Iain Collins
15316f069e Update FAQ to address automatic account linking (#702) 2020-09-24 13:45:45 +01:00
Wédney Yuri
e6995d21cd Update mongodb.md (#673)
Fix typo: MonogDB => MongoDB

Co-authored-by: Lori Karikari <lori.karikari@gmail.com>
2020-09-14 11:08:27 +02:00
Lance Hasson
433f096a63 jst -> jwt (#668)
Co-authored-by: Lori Karikari <lori.karikari@gmail.com>
2020-09-14 11:06:13 +02:00
Lance Hasson
9f487593fa add missing comma in type object (#669) 2020-09-14 11:04:16 +02:00
Matthieu
65caaa6c4c [providers]: Add Atlassian (#664)
* Atlassian provider

* rollback indentation

* fix alphabetical order

* add missing entry in menu sidebar
2020-09-12 19:49:21 +02:00
Iain Collins
0adfba8c5c Improve Puppeteer configuration (#658)
* Centralises configuration for Puppeteer used in tests to make it easier to maintain.
* Adds support for running tests on ARM, so we can use Raspberry Pi test runners off the cloud to get around block lists.
* Includes improved stealth mode to avoid detection which breaks integration tests.
2020-09-11 01:41:02 +01:00
Ugo Onali
2f0f738e2e Fix typo in Prisma adapter doc (#629)
Co-authored-by: Iain Collins <me@iaincollins.com>
2020-09-08 17:26:40 +01:00
Iain Collins
1777a87be3 Increase slow times for integration tests to 5 seconds
This seems like a reasonable theshold for these  integration tests.
2020-09-08 13:12:19 +01:00
Iain Collins
e94fd3b484 Fix typo in package.json 2020-09-08 12:55:26 +01:00
Iain Collins
3b40335202 Add full end-to-end integration tests
Full end-to-end integration tests for Twitter (OAuth 1) and GitHub (OAuth 2) using Puppeteer and Mocha.

This replaces Cypress tests due to issues with Cypress not being able to run tests against external URLs, which we need for our integration tests.

The integration test runner is hosted outside of GitHub Actions (it cannot be hosted by GitHub or on AWS due to IP access controls placed on sign in by providers like Twitter and GitHub) and so the integration tests may not pass if the test runner is offline. If this happens, tests can be re-run later when the test runner is available.

See Pull Request #641 for details.
2020-09-08 12:41:30 +01:00
John
6d63b74db9 Update faq.md 2020-09-07 11:20:55 +01:00
dependabot[bot]
eb26722833 Bump bl from 2.2.0 to 2.2.1
Bumps [bl](https://github.com/rvagg/bl) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v2.2.0...v2.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-04 11:29:48 +01:00
Iain Collins
4937047d19 Update GitHub workflows 2020-09-03 23:47:40 +01:00
Iain Collins
4305964864 Fix linting errors & ignore Cypress tests for now 2020-09-03 23:47:40 +01:00
Iain Collins
91d93fb8fd Integrate Cypress with Docker and GitHub Actions 2020-09-03 23:47:40 +01:00
Iain Collins
e2e28fcfd0 Update package-lock.json 2020-09-03 23:47:40 +01:00
Iain Collins
66afc69a57 Update workflow to run test app 2020-09-03 23:47:40 +01:00
Iain Collins
3046691119 Pass env vars through to test app
Using env vars for options we want to test means we can stop and restart the app to test different options without needing to rebuild the image.
2020-09-03 23:47:40 +01:00
Iain Collins
88b87a53ff Fix linter errors 2020-09-03 23:47:40 +01:00
Iain Collins
f1ae26efb6 Add Dockerfile to run build inside a container
Adds commands to start/rebuild/stop a Docker image of a sample Next.js app that loads the latest build of NextAuth.js from the current directory.

* `npm run test:app:start`
* `npm run test:app:rebuild`
* `npm run test:app:stop`

It is intended for further development for automated testing.

### About the build process

* The Dockerfile uses a multi-stage build process to optimise build performance, but the nature of the process is slow.
* Build times vary depending on computer speed and internet connection.
* Inital build times are slow (it may take 10 minutes or more).
* Subsequent builds on the same computer should be faster (1 minute or less).
* To ensure the package.json is valid, modules required in the next-auth package.json file are re-downloaded* on every build.
* A Docker compose file is used to allow us to extend the test app to run it again multiple databases.

Subsequent updates may look to improve performance, but it's important checks like checking package.json is valid and running the build in isolation are performed.
2020-09-03 23:47:40 +01:00
Matheus Calegaro
ba83685a86 docs(email): fix typo (#628) 2020-09-03 13:23:49 +01:00
Francis Udeji
d514733f13 Remove arrow syntax from examples on pages docs 2020-09-03 11:45:40 +01:00
Jefferson Bledsoe
15cd608b19 Add initial end-to-end tests (#298)
* Add cypress, testing-library/cypress and server dev helper to package dev dependencies

* Add initial signin test and placeholder cypress files

* Add initial signout tests

* Add initial verify-request test

* Move page-only tests into a 'pages' directory

* Add an invalid email signup workflow test

* Use home-page sign in button for email workflow

* Some tests to check that clicking the button takes the user to the correct OAuth page (warning: fragile!)

* Add a couple of npm scripts to make it easier to run/ developer e2e tests

Co-authored-by: Iain Collins <me@iaincollins.com>
2020-09-03 11:41:11 +01:00
Anish
08d7f5d778 Set Discord to Prompt = None (#605)
* Update discord.js

* Migrating from discordapp.com to discord.com
2020-09-01 10:42:10 +01:00
Francis Udeji
a2ba7e9229 Fix typo in options.md file 2020-09-01 10:40:42 +01:00
Iain Collins
7c71a15699 Fix getUserByProviderAccountId in Prisma adapter
Resolves #559
2020-09-01 10:39:38 +01:00
Mr D
351b804606 Adding 'nextauth' user as sysadmin. 2020-08-31 17:55:03 +01:00
Mr D
8f0501b7fe standardize the behaviour of the Docker images 2020-08-31 17:55:03 +01:00
Josh Pollock
73d21e66dd adjust URL for warnings in logger to match docs. (#593)
Fixes #592
2020-08-29 12:49:39 +02:00
youpy
6310311d52 Fix error when profile image is not set (#612) 2020-08-29 12:45:29 +02:00
Esteban Dalel R
d0caba1933 Update pages.md (#585) 2020-08-29 12:36:13 +02:00
Madusha Prasanjith
2f3291e48f [providers]: Add FusionAuth provider (#599)
* Add FusionAuth provider

* Fix issue with FusionAuth docs.
2020-08-29 12:35:13 +02:00
Ray Ma
43d8e3b894 [providers]: Updating Discord provider domain (#590)
Discord is migrating to discord.com, including their OAuth2 API routes. Support for the old domain, discordapp.com, will be dropped on 7 Nov 2020.

Note that the cdn.discordapp.com domain is unchanged. This is intentional, as the cdn domain will not be migrated due to technical restraints on Discord's side.
2020-08-29 12:32:59 +02:00
Nick Noble
5d4eb5d4e0 Fix some typos (#606) 2020-08-29 12:27:43 +02:00
S. Suzuki
7ccdec22cb Update slack.md (#617)
Fix code
2020-08-29 12:23:42 +02:00
Liam norris
2ea64045cb Documentation typos (#575)
Am I misreading this?  These changes should make the parameter to attribute mapping less ambiguous...
2020-08-13 14:34:13 +01:00
Iain Collins
daf97d298d Create SECURITY.md 2020-08-13 12:19:17 +01:00
Iain Collins
ababc7ecdb Merge branch 'main' of https://github.com/nextauthjs/next-auth into main 2020-08-13 12:00:05 +01:00
Iain Collins
33e72b2ae1 Update issue templates 2020-08-13 12:00:02 +01:00
Nico Domino
bf5716c674 Add: ldap auth tutorial example (#566)
* add: ldap auth tutorial example

* update: tutorials page list

* update: NEXTAUTH_SECRET

* Update tutorials.md

Co-authored-by: Iain Collins <me@iaincollins.com>
2020-08-11 13:33:44 +01:00
Iain Collins
c17a3b94f5 Update typeorm-custom-models.md 2020-08-11 12:38:36 +01:00
Iain Collins
19a9c313e0 Delete node.js.yml 2020-08-11 02:29:15 +01:00
Iain Collins
68043e65e4 Create test-build.yml 2020-08-11 02:28:50 +01:00
dependabot[bot]
a6ec60284d Bump prismjs from 1.20.0 to 1.21.0 in /www (#560)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.20.0 to 1.21.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.20.0...v1.21.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-11 01:11:54 +01:00
Nico Domino
ff79c4b95b add: warnings page (#567) 2020-08-11 01:11:18 +01:00
Iain Collins
9c4e41a4c6 Update callbacks.md 2020-08-10 16:16:56 +01:00
Bowen
07ef3d59c5 Update pages.md (#534)
Correct typos with getInitialProps

Co-authored-by: Iain Collins <me@iaincollins.com>
2020-08-06 01:07:10 +01:00
Eli José Carrasquero
4fe7162652 Update pages.md 2020-08-06 01:02:49 +01:00
Alex Cory
950a937633 Update callbacks.md
I was getting this error due to it being a string value.
```sh
[next-auth][error][jwt_session_error] JWTClaimInvalid: "auth_time" claim must be a JSON numeric value
    at isTimestamp (/Users/alex/code/trufans/node_modules/jose/lib/jwt/verify.js:24:11)
    at validateTypes (/Users/alex/code/trufans/node_modules/jose/lib/jwt/verify.js:159:3)
    at Object.module.exports [as verify] (/Users/alex/code/trufans/node_modules/jose/lib/jwt/verify.js:236:3)
    at Object.<anonymous> (/Users/alex/code/trufans/node_modules/next-auth/dist/lib/jwt.js:100:30)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/alex/code/trufans/node_modules/next-auth/dist/lib/jwt.js:22:103)
    at _next (/Users/alex/code/trufans/node_modules/next-auth/dist/lib/jwt.js:24:194)
    at /Users/alex/code/trufans/node_modules/next-auth/dist/lib/jwt.js:24:364
    at new Promise (<anonymous>)
    at Object.<anonymous> (/Users/alex/code/trufans/node_modules/next-auth/dist/lib/jwt.js:24:97) {
  code: 'ERR_JWT_CLAIM_INVALID',
  claim: 'auth_time',
  reason: 'invalid'
}
```
2020-08-06 01:01:57 +01:00
Nick Parks
1cc31def3e Update Google Provider example to be functional
Currently the Google Provider example will always fail due to checking for `email_verified` when the correct response from the server is `verified_email`

next-auth debug output for validation:

```
[next-auth][debug][profile_data] {
  id: 'XXXXXXX',
  email: 'nick@example',
  verified_email: true,
  name: 'Nick Parks',
  given_name: 'Nick',
  family_name: 'XXXX',
  picture: 'XXXX,
  locale: 'en',
  hd: 'example.com'
}
```
2020-08-06 01:00:45 +01:00
dependabot[bot]
92f53c532b Bump elliptic from 6.5.2 to 6.5.3 in /www
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-05 20:49:07 +01:00
Iain Collins
c6d6d9c002 Update documentation for Google 2020-07-31 13:06:22 +01:00
Iain Collins
85b859231c Update documentation 2020-07-31 10:17:07 +01:00
Iain Collins
ea093dc0fc Merge branch 'main' of github.com:iaincollins/next-auth into main 2020-07-31 10:01:04 +01:00
Iain Collins
cd61178f44 Bump version number to 3.1.0 2020-07-31 10:00:56 +01:00
Iain Collins
eb53219cbd Update website and documentation for mssql 2020-07-31 09:39:24 +01:00
Iain Collins
18d70ffbe9 Fix linting 2020-07-31 09:39:24 +01:00
Iain Collins
bdcf823d26 Prevent warning when using mssql conection string 2020-07-31 09:39:24 +01:00
Iain Collins
3aeba2aa09 Allow duplicate NULL email address in MSSQL 2020-07-31 09:39:24 +01:00
Mr D
0793e2c8d8 mssql: back to SnakeCaseNamingStrategy 2020-07-31 09:39:24 +01:00
Mr D
0f01279c91 mssqlTransform 2020-07-31 09:39:24 +01:00
Mr D
8fa9d00958 mssql support 2020-07-31 09:39:24 +01:00
Deeptesh Chagan
ab6ef8a19c re-sync entities on connection if changed in development 2020-07-31 00:26:21 +01:00
Iain Collins
8d68807bfe Remove node-jose dependency
This is an unused dependancy.

`jose` is used instead.
2020-07-30 23:33:29 +01:00
Ben Fox
35fc38c328 More explicit wording 2020-07-30 16:49:18 +01:00
Ben Fox
85eeda5755 Remove comments from config 2020-07-30 16:49:18 +01:00
Ben Fox
2e52c500a1 Add note to local environment setup on hot-reloading server files 2020-07-30 16:49:18 +01:00
Marc
5886f9bea8 Add Provider: Basecamp (#511)
Changes Include:
• Added Basecamp as a provider
• Added Basecamp provider to documentation
• Bumped Version to 3.0.1 in package-lock
2020-07-30 15:12:26 +02:00
Iain Collins
c497dcba26 Update options.md 2020-07-30 09:27:34 +01:00
Ben Silverman
493c45a864 Fix typo in typeorm-custom-models.md
Adapter expects `customModels` property, but doc uses `models`.
2020-07-29 23:10:16 +01:00
Iain Collins
b243b26a3d Update faq.md 2020-07-29 11:11:51 +01:00
Zeb Pykosz
1d0749970a fix(docs): remove arrow from function example 2020-07-29 09:23:02 +01:00
Iain Collins
3474d3e250 Add object type to updateSession save
This isn't technically required (it is working fine currently) but if we specify the type explicitly it should help avoid any problems in future that might be introduced with refactoring.
2020-07-28 09:41:06 +01:00
Iain Collins
a35c3a424c Fix problem updating user in TypeORM adapter
Resolves #493
2020-07-28 09:41:06 +01:00
Brady Caspar
6e65ba87a6 Removing localhost from link 2020-07-27 19:53:34 +01:00
Iain Collins
ae7247f14f Update options.md 2020-07-27 06:28:58 +01:00
Iain Collins
12a5d6b1f4 Fix linter errors 2020-07-27 05:32:01 +01:00
Iain Collins
19da066b04 Bump version number to 3.0.0 2020-07-27 05:22:15 +01:00
Iain Collins
8115a7c66c Add option to get raw JWT from getToken helper 2020-07-27 05:20:34 +01:00
Ben Fox
1ab029c60a Update local environment setup steps to fix npm link problems per issue #472 2020-07-27 05:20:34 +01:00
Iain Collins
d0dbacfc4b Display some error messages on the sign in page
Improves the UX by displaying some error messages on the sign in page
2020-07-27 05:20:34 +01:00
Diego Borges
f6b7e0aad9 Clarify script's intent 2020-07-27 05:20:34 +01:00
Iain Collins
4a23f88180 Add option to reject signIn/authorize callbacks 2020-07-27 05:20:34 +01:00
Iain Collins
f8dbd67a16 Improve homepage 2020-07-27 05:20:34 +01:00
Iain Collins
9406f8b332 Improve callbacks by adding User object to calls 2020-07-27 05:20:34 +01:00
Iain Collins
b0410ed9d4 Improvements to documentation 2020-07-27 05:20:34 +01:00
Iain Collins
8c0d0c4dea Update contributors page 2020-07-27 05:20:34 +01:00
Iain Collins
9446c26419 Improve documentation
* CSS Refactor to make it easier to maintain and UI more consistant.
* Misc small updates to docs
* Split off tutorials into a seperate menu item

I would like to add more tutorials and explainers, including those people have written on other sites.

This is a starting point for that.
2020-07-27 05:20:34 +01:00
Iain Collins
cdfa6008c7 Improve contast on links in docs 2020-07-27 05:20:34 +01:00
Iain Collins
b4bb8bda26 Hotfix for email_verified bug
Not being saved by default on sign in. Discovered in #477
2020-07-27 05:20:34 +01:00
Iain Collins
2c32504cc9 Bump version to 3.0.0-beta.21
Resolves #477 by fixing issue with last build being screwy
2020-07-27 05:20:34 +01:00
Iain Collins
bd188ff410 Improve examples and documentation 2020-07-27 05:20:34 +01:00
Iain Collins
89aedb1285 Fix contrast issues with sidebar menu 2020-07-27 05:20:34 +01:00
Iain Collins
db8c0820b6 Fix typo in docs 2020-07-27 05:20:34 +01:00
Iain Collins
d86464c822 Improve adapter documentation 2020-07-27 05:20:34 +01:00
Iain Collins
fcfeb0ce88 Update database documentation 2020-07-27 05:20:34 +01:00
Iain Collins
01e472912e Update MongoDB test (minor update) 2020-07-27 05:20:34 +01:00
Iain Collins
bbfeac408e Document SQL for MySQL and Postgres
These match up exactly with the models generated by TypeORM in v3 and are suitable for use with Prisma.
2020-07-27 05:20:34 +01:00
Iain Collins
364de1fc6c Update MySQL Model in TypeORM to use TIMESTAMP(6)
An issue with the defaults for MySQL used by TypeORM Adapter has been highlighted during testing parity with the Prisma Adapter.

This change ensures *all* TIMESTAMP columns use TIMESTAMP(6) to store six digits of precision after the number of seconds.

While this is level of precision is not required everywhere it ensures all timestamps in the default models use the same configuration (instead of a mix of values) and is consisitant with the level of precision on timestamps used Postgres.
2020-07-27 05:20:34 +01:00
Iain Collins
52af06cd33 Add Prisma client to optional peer dependencies
This doesn't technically do anything (except for the mongodb peer dependancy, which is invoked when a mongodb is being used) but it provides a way for us to indicate and track the last known good versions of database clients for NextAuth.js.
2020-07-27 05:20:34 +01:00
Iain Collins
8f472c5987 Prisma adapter refactor 2020-07-27 05:20:34 +01:00
Iain Collins
dcbd7a6703 Improve TypeORM adapter (#460)
* Uses `require_optional` and `peerOptionalDependencies` instead of dynamic import to resolve issue some users have experience with using using compliers/bundlers (especially on starter projects) that don't handle dynamic imports well.

This should (hopefully) also make it easier to support older versions of Internet Explorer by avoiding bundlers that choke on dynamic imports unless MongoDB is included as a dependancy (even though it's not code they need to compile).

We use `require_optional` to load `ObjectID` conditionally, if NextAuth.js is using MongoDB. This is also exactly how the MongoDB driver itself loads the ObjectID from the `bson/bson-ext` module.

Should resolve #251
    
* The default name for the TypeORM connection is now 'nextauth' instead of 'default'.

This should help people avoid problems with connection re-use when not using serverless (including in local development), especially if they are doing things with their default connection that differ from whats expected by NextAuth.js (like not using UTF-8 for encoding or UTC timezones).

* Now uses connection manager object from the connection, to allow a custom TypeORM connection name to be specified (resolves #459).
2020-07-27 05:20:34 +01:00
Iain Collins
e6fd4c2edc Improve sidebar apperance 2020-07-27 05:20:34 +01:00
Iain Collins
e19ca19a82 Add tips to provider documentation 2020-07-27 05:20:34 +01:00
Iain Collins
7b1b68e1c4 Fix typos in tutorial code 2020-07-27 05:20:34 +01:00
Iain Collins
56d848c868 Fix return type of sign in callback in docs 2020-07-27 05:20:34 +01:00
Timo Mämecke
100eece7a2 docs: Fix typos and wording in Client API (#455)
While reading through the new v3 docs, I spotted a few typos and some convoluted wording. Hence I directly fixed them.
2020-07-27 05:20:34 +01:00
Ty Lange-Smith
278ecc1e48 Explicitly set expires property for session on updateSession 2020-07-27 05:20:34 +01:00
Fredrik Pettersen
a3d379554b fix(prisma): Explicitly set fields to use when updating user (#449) 2020-07-27 05:20:34 +01:00
Iain Collins
983dd98a66 Fix typo in docs 2020-07-27 05:20:34 +01:00
Iain Collins
ca3f26b8d2 Update configuration docs 2020-07-27 05:20:34 +01:00
Iain Collins
d2a2352e9a Update callback docs
Addresses issue raised in comments on #429
2020-07-27 05:20:34 +01:00
Iain Collins
3043a9525a Update documentation for client methods 2020-07-27 05:20:34 +01:00
Iain Collins
e1c6632b6f Fix typo on homepage 2020-07-27 05:20:34 +01:00
Iain Collins
56e64e322e Move help menu on mobile (again)
So many UX issue with this. Hard to wrangle it given where it is semantically.

Hopefully Docusuarus beta will improve on it in a future release.
2020-07-27 05:20:34 +01:00
Iain Collins
cbd056f225 Fix typo in tutorial 2020-07-27 05:20:34 +01:00
Iain Collins
22ab66f9d8 Cosmetic improvements to docs 2020-07-27 05:20:34 +01:00
Iain Collins
3597733dae Improve FAQ documentation 2020-07-27 05:20:34 +01:00
Iain Collins
cb9ce69ba3 Update JWT questions in FAQ 2020-07-27 05:20:34 +01:00
Iain Collins
c19a79cbca Update database docs 2020-07-27 05:20:34 +01:00
Iain Collins
e97e090b65 Improve heading formatting on docs 2020-07-27 05:20:34 +01:00
Iain Collins
eda4a6d18b Add tutorial showing how to protect pages & routes 2020-07-27 05:20:34 +01:00
Iain Collins
94f66b60d8 Update documentation 2020-07-27 05:20:34 +01:00
Iain Collins
9a85e27c0c Update README 2020-07-27 05:20:34 +01:00
Iain Collins
7fb7e3d1bc Update documentation 2020-07-27 05:20:34 +01:00
Iain Collins
90066fdbec Update homepage copy and package description 2020-07-27 05:20:34 +01:00
Iain Collins
475f0e7b51 Update documentation 2020-07-27 05:20:34 +01:00
Iain Collins
a9131724d6 Update copy on homepage 2020-07-27 05:20:34 +01:00
Iain Collins
55bfb6d9dc Update docs 2020-07-27 05:20:34 +01:00
Iain Collins
af3da3abf8 Fix linting errors 2020-07-27 05:20:34 +01:00
Iain Collins
339d9f2d03 CSS tweaks 2020-07-27 05:20:34 +01:00
Iain Collins
a24fb8b380 Update JWT documentation and FAQs 2020-07-27 05:20:34 +01:00
Iain Collins
65319e3927 Update JWT defaults
* Set encryption: false  by default
 * Use 64 bit input for generated signing key
2020-07-27 05:20:34 +01:00
Iain Collins
19917972ef Review JWT comments; enable zip encoding 2020-07-27 05:20:34 +01:00
Iain Collins
c1b412814a WIP refactor JWT based on feedback 2020-07-27 05:20:34 +01:00
Iain Collins
53ea8407ea Remove default iss check (makes it optional) 2020-07-27 05:20:34 +01:00
Iain Collins
66f46e8cc7 Use URL to ensure secret is unique per instance 2020-07-27 05:20:34 +01:00
Iain Collins
fec69a21be Refactor JWT payload to use claims
Resovles #224
2020-07-27 05:20:34 +01:00
Iain Collins
505ebb8ae1 Clean up cruft in JWT class; add comments 2020-07-27 05:20:34 +01:00
Iain Collins
fb4381d8eb Implement JWE 2020-07-27 05:20:34 +01:00
Iain Collins
4772f5b571 WIP evaluating JWE solutions 2020-07-27 05:20:34 +01:00
Iain Collins
481db425d6 WIP Add JWE
Working implementation (with limited key length and no exp check) using node-jose from Cisco.

I want to compare it panva/jose which has more features before building it out.
2020-07-27 05:20:34 +01:00
Iain Collins
b886729bb8 Update version to 3.0.0-beta.18 2020-07-27 05:20:34 +01:00
Iain Collins
3a21a9c9f1 Enforce HMAC-256 on JWT
Now that we are going to expose the option to disable encryption on tokens we need to enforce the algorithm is valid (e.g. not 'None' or 'RSA') to prevent vultrabilties being exploited by tampering with the token.

Custom encode/decode routines can be specified if someone needs to use another algorithm.
2020-07-27 05:20:34 +01:00
Iain Collins
9e4a6fec59 Update JWT and session docs 2020-07-27 05:20:34 +01:00
Iain Collins
86921022dc Refactor JWT support
* Adds option to disable encryption
* Easy to add custom helper
* Removed getJWT helper
* Added getToken helper
* Helper does not fallback to trying non-prefixed cookie on HTTPS sites
* Supports bearer tokens in HTTP header on helper #397
2020-07-27 05:20:34 +01:00
Iain Collins
f57f11e6ff Bump version to 3.0.0-beta.17 2020-07-27 05:20:34 +01:00
Iain Collins
77ad6bd97e Update FAQ 2020-07-27 05:20:34 +01:00
Iain Collins
78c7041b3f Improve docs site on mobile 2020-07-27 05:20:34 +01:00
Iain Collins
99edead0f2 Add FAQ 2020-07-27 05:20:34 +01:00
Iain Collins
b0b3dbc0fc Add provider icons to homepage 2020-07-27 05:20:34 +01:00
Iain Collins
8b5af54e1c Update documentation 2020-07-27 05:20:34 +01:00
Iain Collins
0b5b04a22f Apply datetime transforms on properties in custom models
It makes sense to change this behaviour now we have a tutorial and have been testing this functionality.

Docs are being updated to reflect this change.
2020-07-27 05:20:34 +01:00
Iain Collins
890be1de0d Update email provider 2020-07-27 05:20:34 +01:00
Iain Collins
40ae747bc1 Add support for passing appContext to getCsrfToken
Requested in #345

getSession() already does this so seems reasonable to support it in getCsrfToken too.
2020-07-27 05:20:34 +01:00
Iain Collins
5a8022e9a2 Update homepage and refactor CSS
Making an attempt to clean up some of crusty CSS I've added.
2020-07-27 05:20:34 +01:00
Iain Collins
3e512b5cf5 Tweak CSS on homepage 2020-07-27 05:20:34 +01:00
Iain Collins
81071d7776 Update adapters documentation 2020-07-27 05:20:34 +01:00
Iain Collins
fc05140c1f Improve homepage 2020-07-27 05:20:34 +01:00
Iain Collins
faec6824ba Disable use of state on Apple provider
It is not supported by Apple ID.
2020-07-27 05:20:34 +01:00
Iain Collins
b91bfef16d Refactor and document state provider option 2020-07-27 05:20:34 +01:00
Iain Collins
ba9dc17e44 Update homepage 2020-07-27 05:20:34 +01:00
Iain Collins
c220bcc57e Update version to 3.0.0-beta.13 2020-07-27 05:20:34 +01:00
Iain Collins
f8a4808aa7 Fix bug with NEXTAUTH_URL parsing 2020-07-27 05:20:34 +01:00
ndo@$(hostname)
495d0a47db fix: marquee icons 2020-07-27 05:20:34 +01:00
Iain Collins
8cda627fe6 Update adapter documentation 2020-07-27 05:20:34 +01:00
Iain Collins
d0a0ccc6bc Update TypeORM tutorial 2020-07-27 05:20:34 +01:00
Iain Collins
999222cd97 Refactor to simplify site URL configuration
Includes some linter fixes
2020-07-27 05:20:34 +01:00
Iain Collins
72eb7fda3f Fix error merging branches for v3
Accidentally squashed a couple of lines in OAuth callback.
2020-07-27 05:20:34 +01:00
Iain Collins
3c94940ae6 Respect existing cookies on a request object
Unproven, but should fix #395 and improve middleware compatibility.
2020-07-27 05:20:34 +01:00
Iain Collins
1a8ed2aec1 Update version to 3.0.0-beta.9 2020-07-27 05:20:34 +01:00
Iain Collins
0e2321dc14 Update pages documentation 2020-07-27 05:20:34 +01:00
Iain Collins
78d1983f9a Update version to 3.0.0-beta.8 2020-07-27 05:20:34 +01:00
Iain Collins
5435df110c Fix linter errors 2020-07-27 05:20:34 +01:00
Iain Collins
32853b8d1e Update events, callbacks & pages to use camelCase
* This is a breaking change in v3
* Includes updated documentation
2020-07-27 05:20:34 +01:00
Iain Collins
9737b4c6ab Only invoke setTimeout client side
This should never be called server side, but just in case someone calls setOptions server side this prevents it from being invoked at all.
2020-07-27 05:20:34 +01:00
Iain Collins
e9bdd5c355 Improve client event handling
Improves how well syncing client state is handled and how well caching is leveraged.

Reduces network load, cpu load and memory footprint.
2020-07-27 05:20:34 +01:00
Iain Collins
9728567296 Improve client state syncing
* clientMaxAge now passive
* clientPollInterval added (works like old clientMaxAge)
* poll intervals uses timer (more efficent)
* updates state on window focus/blur
2020-07-27 05:20:34 +01:00
Iain Collins
ef6579a7ee Refactor redirect handling (WIP)
Passing a redirect function like this is a bit horrible, but is less horrible than before.
2020-07-27 05:20:34 +01:00
Iain Collins
8e810aa765 Fix linting errors and bug in getCsrfToken 2020-07-27 05:20:34 +01:00
Iain Collins
37596edf2b Improve CSRF security for all routes
Includes breaking changes for v3 and updates to documentation.

If using the client, the only required change should be setting the NEXTAUTH_URL environment variable.
2020-07-27 05:20:34 +01:00
tmayr@tmayr.com
229a3e430e Add tutorial on how to use custom typeorm models 2020-07-27 05:20:34 +01:00
Nico Domino
1d80f595c5 Add provider Vercel-style marquee to docs
* add: marquee provider section
* fix: lint
* update: adjust node sizes
* fix: window undefined SSR
* fix: path to imgs

Co-authored-by: Iain Collins <me@iaincollins.com>
2020-07-27 05:20:34 +01:00
Iain Collins
189a2c8e0e Fix for reading private key in Apple provider 2020-07-27 05:20:34 +01:00
Iain Collins
97096fb811 Fix linter errors and add comments 2020-07-27 05:20:34 +01:00
Gerald Nolan
e8b75e40b1 feat: Added UserData to ProfileData after return from Apple to get user name on first sign in 2020-07-27 05:20:34 +01:00
Iain Collins
d41c38e002 Add support for hitting cancel if using token id
When using a provider that uses Token ID option (like Apple) a user hitting cancel with no longer cause the app to crash.

Users who do this will now be taken back to the sign in page.

This was already working for other providers that didn't use this option but wasn't supported for providers that did use it.
2020-07-27 05:20:34 +01:00
Fredrik Pettersen
966bc7b433 docs(prisma): Add note about model names and set email to optional 2020-07-27 05:20:34 +01:00
Fredrik Pettersen
e7b06d3362 fix(prisma): Make sure provider id is a string 2020-07-27 05:20:34 +01:00
Fredrik Pettersen
d5d8eb8d7c feat(adapter): Add opinionated prisma adapter 2020-07-27 05:20:34 +01:00
nyedidikeke
8ec07f0224 Add LinkedIn provider 2020-07-27 03:22:43 +01:00
dan-kwiat
558536db1e docs(options): remove duplicate arrow 2020-07-23 10:30:50 +01:00
Lori Karikari
0c2fe054d1 [Docs] fix small typo 2020-07-20 17:46:48 +02:00
dependabot[bot]
b5a69fd787 Bump lodash from 4.17.15 to 4.17.19 in /www
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-17 12:31:11 +01:00
dependabot[bot]
9b29ed347d Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-17 12:06:12 +01:00
Jibin George
c5c4ff4d51 Fix typo 2020-07-15 13:30:01 +01:00
styxlab
008b1a9f8d fallback if user.name is null (#424)
Co-authored-by: cws <cws@home.fritz.box>
2020-07-12 18:52:58 +02:00
Iain Collins
4a6f153aa6 Update question.md 2020-07-10 16:14:10 +01:00
Iain Collins
9eccc78e3a Update feature_request.md 2020-07-10 16:13:12 +01:00
Iain Collins
09938cc368 Update bug_report.md 2020-07-10 16:12:59 +01:00
Jake Harding
5db05e1031 Use id_str for reading in Twitter user ID 2020-07-09 11:07:18 +01:00
Ryuichi Okumura
f6ba72b4fa Fix wrong syntax in Apple provider example
It fixes a syntax error in Apple provider example code.
2020-07-07 19:38:44 +01:00
Jonathan Dean
bf7e555cfa Fix typo: curly brace should be square bracket 2020-07-07 19:35:36 +01:00
William Duplenne
26abc70a99 Add Spotify provider
Add Spotify to the sidebar
2020-07-07 08:35:55 +01:00
tmayr@tmayr.com
d38cd54dee Fix using merged models var instead of user provided models in props
Merged models were being overwritten by user provided models which
might come incomplete
2020-07-06 20:51:36 +01:00
felipe muner
200690ad6c Update pages.md (#389) 2020-07-05 10:58:09 +02:00
Nico Domino
52b69a6d68 Add: testing with cypress docs (#357)
* add: testing with cypress docs

* update: add tutorials group
2020-07-04 21:47:00 +02:00
Theo Gravity
f319b2af05 Fix reading of req in getSession() 2020-07-04 01:27:03 +01:00
Iain Collins
b80a005733 Update callbacks.md 2020-07-01 17:16:15 +01:00
Arunoda Susiripala
34936aecc0 Pass maxAge to the 'jwt.getJwt' function
With that it can pass that to the `jwt.decode` method. This will be useful, if we are using a custom `maxAge` value.
2020-07-01 10:46:35 +01:00
Tom Astley
b021f26f03 Update client.md (#370)
Fixed small syntax error on line 219 in the signout example. Added a '('
2020-06-30 11:56:47 +02:00
Iain Collins
fcf7197120 Fix indentation in example (trivial) 2020-06-30 10:47:29 +01:00
Iain Collins
bec8d8dff1 Update callbacks.md 2020-06-30 09:30:01 +01:00
Iain Collins
781c63e966 Update pages.md 2020-06-30 08:52:58 +01:00
Iain Collins
2da1883726 Fix typo in email.md 2020-06-30 08:52:18 +01:00
Thibaut Patel
83ffac7cd2 Fix missing closing tag in docs 2020-06-28 21:09:11 +01:00
Iain Collins
6198903cdf Update copy on homepage 2020-06-28 14:49:30 +01:00
Iain Collins
bd98f8188c Update introduction.md 2020-06-28 14:40:29 +01:00
Iain Collins
73ea402b1c Compress images
* Forgot to do this when I added them.
* May add a script to compress them on commit.
* Adding new binary blobs bloats repo over time, we can always purge old assets if it's a problem.
* The social card is slightly too bright to compensate for PNG gamma interpretation not being consistant between browsers (too bright in some looks better than too dark in others). Maybe it should be a JPEG.
2020-06-28 14:03:23 +01:00
Iain Collins
4284684a3b Improve apperance of documentation on mobile 2020-06-28 10:51:51 +01:00
Iain Collins
b5d522410a Update CSS
Additional changes following testing on mobile.
2020-06-28 10:51:51 +01:00
Iain Collins
284cb8e2a7 Improve website CSS on mobile and dark mode 2020-06-28 10:51:51 +01:00
Iain Collins
079aab2315 Improve mobile documentation secondary menu
Still not great, but somewhat better.
2020-06-28 10:51:51 +01:00
Iain Collins
645ee382cf Improve documentation structure / sidebar 2020-06-28 10:51:51 +01:00
Iain Collins
e947a772ce Website cosmetic refresh
Addressing quality issues with assets and layout
2020-06-28 10:51:51 +01:00
Iain Collins
5d63adf7df Update errors.md 2020-06-26 17:22:18 +01:00
Iain Collins
f1a872f861 Update errors.md 2020-06-26 16:39:48 +01:00
Iain Collins
02b1d02f09 Update cognito.md 2020-06-26 12:56:53 +01:00
Iain Collins
a3479b3503 Bump version to 2.2.0 2020-06-25 22:50:50 +01:00
Iain Collins
740535a8f2 Add support for mongodb+srv:// URLs 2020-06-25 22:49:56 +01:00
Iain Collins
19ed684a52 Add HTTP status codes to error pages 2020-06-25 22:47:08 +01:00
Iain Collins
bd72949fa7 Fix typos in docs 2020-06-25 22:44:31 +01:00
Iain Collins
a277cd5b0c Fix linter errors 2020-06-25 22:38:07 +01:00
Iain Collins
fd6e7e94df Update version to 2.2.0-beta.0
*  New email template
*  New callback error handling

I anticipate adding more changes and a new beta before we release 2.2.0 but wanted to test these changes.
2020-06-25 18:04:35 +01:00
Iain Collins
2f6403478d Improve apperance of sign in email
* Prevents links from being turned into hyperlinks by email clients
* Improve UI with a primary action button and better font sizing and spacing in the template
* Adds email address to body to clear indicate who they will be signing in as

While not exactly a bug in NextAuth.js it does resolve #331
2020-06-25 17:43:35 +01:00
Iain Collins
a4372ffc61 Handle OAuth sign in cancellations gracefully
Currently if a user hits a cancel button after selecting the option to sign in with an OAuth provider an error is displayed.

This error is only triggered in production.

This update refactors error handling so that in both dev and prod modes, the user is directed back to the sign in page.

Not all OAuth providers have a cancel button on their sign in page (e.g. Twitter does, Google doesn't).

The oAuthCallback has been slightly refactored to make debugging easier. It is still pretty horrible, but i don't want to do major refactoring of it until we have tests we trust in place.
2020-06-25 17:37:17 +01:00
Iain Collins
d6ce92811e Update documentation for credentials provider
There was a typo in the documentation and some of the documentation was outdated.
2020-06-25 02:35:43 +01:00
Sreetam Das
e5aecdf315 fix link in client API docs (#323) 2020-06-24 12:33:27 +02:00
Iain Collins
6d1c457a75 Add action to run npm test on new pull requests 2020-06-24 02:23:48 +01:00
Iain Collins
6e16aec6d3 Update test to run linter
The action to publish to NPM fails as it can't run the DB test yet so removing that.

Changing the test to run the linter instead so it does something (e.g. catch the worst syntax errors).
2020-06-24 02:13:02 +01:00
Iain Collins
f899d7bb04 Update version to 2.1.0 2020-06-24 01:57:28 +01:00
Iain Collins
e36646ce7f Update docs formatting 2020-06-24 01:53:49 +01:00
Iain Collins
f3d36a74c9 Update provider documentation 2020-06-24 01:53:49 +01:00
Iain Collins
4e11c9c36e Fix linter errors 2020-06-24 01:26:07 +01:00
Iain Collins
0a7ac36584 Update client documentation 2020-06-24 01:26:07 +01:00
Iain Collins
fc4850f354 Update documentation for client and options 2020-06-24 01:26:07 +01:00
Iain Collins
6e9a8d2074 Update beta version 2020-06-24 01:26:07 +01:00
Iain Collins
c712d7da07 Remove base URL cookie; no longer needed 2020-06-24 01:26:07 +01:00
Iain Collins
5183181d1c Refactor client to allow provider to be passed options 2020-06-24 01:26:07 +01:00
Iain Collins
b024f89ba8 Update client max age documentation 2020-06-24 01:26:07 +01:00
Iain Collins
fbbe516b9a Refactor client to take configuraiton from _app.js 2020-06-24 01:26:07 +01:00
Iain Collins
d48a3fd948 Rename internal debug env var for consistancy
This is a naughty global used server side to more easily facilitate debugging.
2020-06-24 01:26:07 +01:00
ndo@$(hostname)
86f0c53bd3 add: npm publish workflow 2020-06-24 01:19:51 +01:00
Onur
7f6cc2048b Minor typo fix 2020-06-24 00:00:09 +01:00
Lori Karikari
b2829f6384 added missing comma to homepage example 2020-06-23 18:33:59 +02:00
Iain Collins
67c5041860 Remove console.log from auth0 provider 2020-06-23 13:00:25 +01:00
Lori Karikari
33df9e3132 updated Cognito (#307) 2020-06-23 11:40:18 +02:00
Lori Karikari
602bc28a45 Add new OAuth providers (#221) 2020-06-23 11:31:18 +02:00
jose-donato
5a7a494701 typo 2020-06-23 00:34:44 +01:00
Iain Collins
9fa82cedbd Fix Auth0 provider
Resolves #301
2020-06-23 00:13:55 +01:00
Iain Collins
b0408284b8 Tweak homepage CSS 2020-06-21 17:30:43 +01:00
Iain Collins
388a1c4393 Remove references to beta URLS from docs 2020-06-21 17:00:33 +01:00
Iain Collins
5c9aaeae43 Set default site name and remove old slug param
* Removing the old 'slug' param as it was only used in early beta releases
* No default site name makes it harder to debug when you forget to set it
* Setting it to http://localhost:3000 makes it more obvious when you see it in errors
2020-06-21 17:00:33 +01:00
Iain Collins
0eaec78399 Bump version number for release 2020-06-21 17:00:33 +01:00
Iain Collins
9349ca3b34 Updates to documentation and homepage CSS 2020-06-21 16:20:38 +01:00
Iain Collins
52f2dd5c32 Add JS wrapper to CSS to support Serverless target
Resolves #281
2020-06-21 15:07:01 +01:00
Iain Collins
6eeed21872 Merge branch 'main' of github.com:iaincollins/next-auth into main 2020-06-21 11:23:32 +01:00
Iain Collins
929a7e5840 Fix broken links in documentation 2020-06-21 11:23:27 +01:00
Iain Collins
758b3a88d0 Update beta version to 85 2020-06-21 04:43:13 +01:00
Iain Collins
4477bd6c80 Remove session payload from triggers
Each message trigger needs a unique payload but we don't have to pass the session data.

It would not be terrible to pass the session data, but persisting it in localStorage is likely cause confusion and makes it easier for third party scripts to scrape.
2020-06-21 04:43:13 +01:00
Iain Collins
370d2cc121 Update documentation 2020-06-21 04:43:13 +01:00
Iain Collins
e6c4d6e737 Add session sync across windows/tabs
Uses the localStorage API to trigger events across tabs, as is more widely supported than the broadcast API.
2020-06-21 04:43:13 +01:00
SabariVig
5bd2936b90 Added Providers To Sidebar 2020-06-21 02:37:17 +01:00
Iain Collins
41b6bb7000 Fix linter errors 2020-06-21 02:32:03 +01:00
Iain Collins
fd8818c400 Add callbackUrl option to client methods
Resolves  #208

Also address fetchData not returning a promise when it should.
2020-06-21 02:26:34 +01:00
Iain Collins
5929de4249 Remove babel-preset-minify
It made debugging harder and I don't think it's currently worth the tradeoff.

In future we might bring it back conditionally (e.g. prod builds only).
2020-06-21 01:54:18 +01:00
Iain Collins
07c6cbccc0 Update beta version to 83 2020-06-21 01:44:41 +01:00
Iain Collins
f20843fcb1 Use timestamp with time zone Postgres databases 2020-06-21 01:44:41 +01:00
Iain Collins
eb6a7a45a5 Refactort timestamps, add email verified timestamp
* Saves email verified date on user when an email sign in link is used
* All timestamps now use UTC date objects in database
* Stored as UTC regardless of server timezone
* Tested with MySQL and MongoDB
* Investigating issues with Postgres
2020-06-21 01:44:41 +01:00
Iain Collins
75638db676 Bump beta version to 82 2020-06-20 11:58:28 +01:00
Iain Collins
76fcfa53f4 Add new documentation for credentials provider 2020-06-20 11:58:28 +01:00
Iain Collins
708ec9fbe7 Improve sign in page
* Add label to email sign in
* Add support for custom credentials to sign in form
* Add explict error for rejected credentials

Documentation to follow.
2020-06-20 11:58:28 +01:00
Iain Collins
ca98750604 Merge branch 'main' of github.com:iaincollins/next-auth into main 2020-06-20 09:27:36 +01:00
Iain Collins
eb49a47b0a Bump beta version to 81; hotfix for sqlite
Includes hot fix for SQLite transform.

It was not updated to support column name changes.

The fix applies the transform without relying on hard coded values so bug won't happen again.
2020-06-20 09:27:28 +01:00
Iain Collins
ac2fc85d18 Fix linting errors 2020-06-20 08:48:54 +01:00
Iain Collins
4ee2b4453d Refactor IdentityServer4 provider
NB: The ...options spread takes care of conditionally overriding default property values.
2020-06-20 08:48:54 +01:00
Iain Collins
0542b6a24a Add Yandex provider 2020-06-20 08:48:54 +01:00
Iain Collins
ca0053b6cd Add box.com provider
Resolves #242
2020-06-20 08:48:54 +01:00
Iain Collins
a902b98cfd Rename Gitlab to GitLab 2020-06-20 08:48:54 +01:00
SabariVig
99ff0ffd3d Doc Typo 2020-06-20 08:25:45 +01:00
SabariVig
5bb1830c9b Added Documentation for Gitlab 2020-06-20 08:25:45 +01:00
SabariVig
6055ecda24 Added to providers/index.js And link typos in Readme 2020-06-20 08:25:45 +01:00
SabariVig
8229a3b420 Gitlab Provider 2020-06-20 08:25:45 +01:00
Iain Collins
20723fd2b4 Update mongodb test 2020-06-20 08:23:02 +01:00
Iain Collins
31d9363954 Update schema fixtures and docs 2020-06-20 08:23:02 +01:00
Iain Collins
515facf39f Add support for mongodb+srv URLs 2020-06-20 08:23:02 +01:00
Lori Karikari
173ce2aae6 [docs] update custom page signin() value
Changed docs to use the provider id instead of the provider object as shown in #284
2020-06-19 17:20:12 +02:00
Iain Collins
935c4f2f82 Update CONTRIBUTING.md 2020-06-19 08:28:35 +01:00
Iain Collins
b893b6485b Refactor db tests an update docs 2020-06-19 08:28:35 +01:00
Iain Collins
6f5b3bd213 Refactor models to use created_at / updated_at 2020-06-19 08:28:35 +01:00
Iain Collins
14fd1c9b40 Update feature_request.md 2020-06-18 17:34:14 +01:00
Daniel Baker
c695ca98e5 Fix typo in auth0 provider config
auth0 was configured with `respponse_type` but should be `response_type`
2020-06-18 17:20:20 +01:00
Lars Eckervogt
7649eb7aed Fix documentation for getSession and update imports to be consistent 2020-06-16 22:03:56 +01:00
Iain Collins
0119622d18 Update issue templates to point to documentation
Have been the asked some questions a few times (including via email).

Most of the time these reports have already been addressed.

Trying to nudge behaviour to check the example project and docs first.

Also want to understand where people couldn't find what they needed.

Removed pre-filled issue title as people were forgetting to change it.
2020-06-16 18:19:38 +01:00
Lori Karikari
15c6781083 fixed some small typo in models docs 2020-06-15 21:02:02 +02:00
Gerald Nolan
574387e09f Added IdentityServer4 2020-06-15 17:27:13 +02:00
Jefferson Bledsoe
aa1f29dc53 Documentation typo fixes (#268) 2020-06-15 17:19:05 +02:00
Jefferson Bledsoe
bb9a26d4fc Change all instances of "identifer" to "identifier" (#267) 2020-06-15 17:12:37 +02:00
Iain Collins
4b036d3beb Update credentials.md 2020-06-15 09:28:06 +01:00
Iain Collins
6dd8dc325e Update callbacks.md 2020-06-15 09:26:07 +01:00
Iain Collins
22005c7465 Update callbacks.md 2020-06-15 09:25:23 +01:00
Iain Collins
0686b5ff32 Bump beta version to 78 2020-06-15 08:58:10 +01:00
StefanWerW
f495ecda3a Fixes no adapter error
Fixes #263
2020-06-15 08:56:29 +01:00
Iain Collins
1f4bc91d87 Add limited support for credentials sign in 2020-06-15 04:01:52 +01:00
Iain Collins
e54bf254cb Bump beta version to 76 2020-06-15 01:09:03 +01:00
Iain Collins
fc2d3adc1f Improve built-in pages on mobile
Resolves #231 for now.

I think there is stil room for improvement, but these tweaks will do for now I think.
2020-06-15 01:08:05 +01:00
Iain Collins
18c99616b3 Bump beta version to 75 2020-06-15 00:03:06 +01:00
Iain Collins
70e3ab7e89 Update callbacks and events documentation 2020-06-15 00:03:06 +01:00
Iain Collins
9b25a2d245 Add OAuth profile to JWT callback on sign in 2020-06-15 00:03:06 +01:00
Iain Collins
966aa8245d Wire up supported events so they are triggered 2020-06-15 00:03:06 +01:00
Iain Collins
d220587018 Add description for each event 2020-06-15 00:03:06 +01:00
Iain Collins
c665631191 Refactor callbacks, add events; add debug logging
* New callbacks implemented
* Some events added (not all wired up)
* Documentation for old callbacks removed, new documentation to be added
* All flows seem to be working with all databases.
* If debug is set to true, debug messages can now be easily logged anywhere in the app

The refactoring has been a success - the code is much more maintainable and the flows are better.

This update need further testing to be sure it's all working as intended
2020-06-15 00:03:06 +01:00
Iain Collins
6032a99a90 Add callbacks and events 2020-06-15 00:03:06 +01:00
Iain Collins
d130251b41 Add file for Google Search Console verification
This is so we can control how the site appears in Google.
2020-06-14 15:13:08 +01:00
Iain Collins
4dd8d3160b Merge branch 'main' of github.com:iaincollins/next-auth into main 2020-06-14 14:49:26 +01:00
Iain Collins
667fe8cf50 Update documentation
* Combined options and advanced options into one page
* Improved structure of sidebar
* Other miscellaneous edits
2020-06-14 14:49:20 +01:00
Iain Collins
554c32c6f1 Refactoring naming strategy
Not a breaking change, just a refactor!

* Removes dependency on external library
* Resolves problem of messy logic in models and transform by putting it all in a naming strategy
* No change to table / collection schemas!
2020-06-14 14:15:28 +01:00
Iain Collins
bdc0e8e16f Update documentation 2020-06-14 04:55:56 +01:00
Iain Collins
3b0527add8 Fix typo in docs 2020-06-14 04:39:44 +01:00
Iain Collins
2b494357e5 Update documentation 2020-06-14 04:39:01 +01:00
Iain Collins
7a0624b8db HOTFIX for sqlite schema transform 2020-06-14 04:13:26 +01:00
Iain Collins
bb8a2c94cc Update postgres.md 2020-06-14 04:01:24 +01:00
Iain Collins
f3532ebef2 Update models to use better table/collection names
* Use plural table/collection names
* Use snake_case on SQL
* Use camelCase on Document DB
* Updated docs
2020-06-14 03:50:22 +01:00
Iain Collins
c5fad1b933 Update user model documentation 2020-06-14 03:50:22 +01:00
Iain Collins
5e9f392ba8 Bump beta version to 72 2020-06-14 03:50:22 +01:00
Iain Collins
f1ed5c1e97 Update documentation
This is a larger update to the documentation than I had planned in this PR but I think makes sense to do it together as so much of it is related.
2020-06-14 03:50:22 +01:00
Iain Collins
5946710fe8 Refactor getProfileFromToken to idToken
This is a minor change to an undocumented feature, but makes sense to rename it while I'm documenting it.
2020-06-14 03:50:22 +01:00
Iain Collins
5cf0056e69 Add script to extract schema from databases 2020-06-14 03:50:22 +01:00
Iain Collins
ac12d6a6e2 Add database drivers as devDependencies for testing 2020-06-14 03:50:22 +01:00
Iain Collins
cc0c15e37c Refactor models and schemas 2020-06-14 03:50:22 +01:00
Iain Collins
9a630dcb01 Rename master branch to main 2020-06-13 19:55:19 +01:00
Iain Collins
d30b112d71 Add getProfileFromToken option 2020-06-12 02:08:43 +01:00
Iain Collins
5fded4256d Add issue templates
Trying to create some structure to get external contributors to think about feature requests and/or provide more information when raising issues.

This is not intended for core committers - I'm just trying to wrangle the input we get to reduce signal to noise, especially as I'm also starting to get emails asking for support now.
2020-06-12 01:06:55 +01:00
Iain Collins
d2fdfa7528 Fix typo in adapter docs 2020-06-12 00:23:25 +01:00
Iain Collins
55c3acab9a Fix for unique emails in MongoDB
The previous approach didn't work at enforcing uniqueness, but have double checked that this approach does.
2020-06-11 13:10:59 +01:00
Iain Collins
dc903f8059 Refactor debug messages in adaptor
Format is now consistant with error logs
2020-06-11 13:10:59 +01:00
Iain Collins
156c8e1e97 Make email addresses optional when signin in 2020-06-11 13:10:59 +01:00
terrierscript
78ba85e74d Fix typo 2020-06-10 00:48:20 +01:00
Iain Collins
6d41089d48 Fix typo in introduction.md 2020-06-09 16:41:13 +01:00
Iain Collins
64b23d484d Fix typo in errors.md 2020-06-09 16:39:05 +01:00
StefanWerW
5f65e8c30d Update example.md 2020-06-09 15:50:39 +01:00
StefanWerW
49d560fa24 Update google.md 2020-06-09 10:04:33 +01:00
Iain Collins
36c469660e Update JWT docs 2020-06-09 09:44:35 +01:00
Iain Collins
416785941b Added JWT helper method 2020-06-09 09:44:35 +01:00
Iain Collins
799bd2dfaa Updated error docs and logger 2020-06-09 09:44:35 +01:00
Nico Domino
c0ccbc9274 WIP: Console Errors with URLs (#222)
* test: override console.error

* update: clean up test URL + test docs

* refactor console.error override into own iife

* update: import override into client + typeorm

* chore: organise errors.md page

* fix: lowercase errorCode required for hash

* update: refactor error fn into own fn instead of (ab)using console.error itself

* add: bold docs msg in console

* update: err function rename + prepare docs URL for prod
2020-06-08 17:57:03 +02:00
Nicola Molinari
0918cdbfa0 fix: missing file export jwt.js in npm release 2020-06-08 14:45:01 +01:00
Iain Collins
077f60e7c4 Allow session.get callback to use data from JWT 2020-06-08 12:25:01 +01:00
Iain Collins
96900e77f6 Fix typos in README 2020-06-08 10:56:17 +01:00
Iain Collins
f43343bd2c Reduce line length of comment in example 2020-06-08 10:45:54 +01:00
Iain Collins
8e69940ae6 Fix typos in documentation 2020-06-08 10:42:10 +01:00
Iain Collins
0d825bbc39 Refactor JWT, Sessions and add allowSignin() method (#223)
## Database

- [x] Databases are now optional - useful with OAuth + JWT if you only need access control
- [x] Updated documentation and added example code for custom database adapters

## JWT

- [x] JWT option is now an object that groups JWT related options together (was a boolean)
- [X] Refactored JWT lib and add AES encryption / decryption as well as signing / verification
- [x] Allows JWT encode/decode methods to be overridden as options
- [x] Contents of JWT can easily customised - without needing to use custom encode/decode
- [x] Exported JWT methods so they can be called from custom API routes
- [x] Updated documentation for new JWT options

## Sessions

- [x] All session options (eg. `maxAge`, `updateAge`) now grouped under single `session` option
- [x] Using JWT for sessions is now enabled from session object (`session.jwt: true`)
- [x] All options involving time now use seconds (instead of milliseconds) for consistency
- [x] Added option to customise the Session object that is returned from `/api/auth/session`
- [x] Update documentation for new Session options

## Other improvements

- [x] Added `allowSignin()` option to control what users / accounts are allowed to sign in
- [x] Refactored `callbackUrlHandler()` - this option  is now called `allowCallbackUrl()` 
- [x] Minor improvements to NextAuth.js client API methods
- [x] Minor to NextAuth.js API routes
- [x] Minor improvements to built-in error pages
- [x] Refactored database models
   All tables now include a `created` column for each row which contains the `datetime` of when the row (e.g. User / Account / Session) was created.
  Additionally, sessions now use the name 'expiry' for the expiry `datetime` value for consistency with other models.
2020-06-08 04:01:21 +01:00
Gerald Nolan
35123f005a Fixed Google Link 2020-06-07 11:51:05 +02:00
Lori Karikari
b25730fbd5 Simplified Auth0 config (#219)
* simplified auth0 conf and made domain stuff more consistent across providers that need one

* removed console.log()

* removed too much
2020-06-06 18:27:23 +02:00
Lori Karikari
585be4ce4a Seperate provider docs (#214)
* added page for Okta

* updated oauth section of provider docs

* added docs for each provider

* email provider
2020-06-06 15:20:01 +02:00
Gerald Nolan
3b5d4b6925 Added Link to ServiceID
Updated App Configuration link to Apple developer portal
2020-06-06 08:15:51 +02:00
dependabot[bot]
39471e9bae Bump websocket-extensions from 0.1.3 to 0.1.4 in /www
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-06 03:23:50 +01:00
Iain Collins
50039e5a6b Bump beta version to 62
This includes the OKTA provider and an improved README.
2020-06-06 03:02:10 +01:00
Iain Collins
cb31f9e554 Fix typos in in README.md URLs
🤦
2020-06-06 02:08:49 +01:00
Iain Collins
f21fb0f46d Update introduction.md 2020-06-06 02:05:04 +01:00
Iain Collins
13c6801c45 Update README.md 2020-06-06 02:04:40 +01:00
Iain Collins
1a1b0ffdc6 Add sharing image for Facebook and Twitter 2020-06-06 01:56:44 +01:00
ndo@ndo3
a638e2b27a chore: cleanup 2020-06-06 01:52:36 +01:00
ndo@ndo3
3ce64da78f update: line length to avoid horizontal scroll 2020-06-06 01:52:36 +01:00
ndo@ndo3
5537514b4f update: pull meta info from docusaurus config 2020-06-06 01:52:36 +01:00
ndo@ndo3
42363101f8 update: essential meta tags 2020-06-06 01:52:36 +01:00
ndo@ndo3
bdafc4a2f7 add: meta images / descriptions 2020-06-06 01:52:36 +01:00
Iain Collins
bdb1216119 Fix broken logo src 2020-06-06 01:52:36 +01:00
Iain Collins
e509c28a4f Update docs, mostly for custom pages 2020-06-06 01:52:36 +01:00
Iain Collins
4f5954938a Add logo 2020-06-06 01:52:36 +01:00
mdemin914
267a166895 adding support for Okta as a provider (#213) 2020-06-05 22:55:48 +02:00
Iain Collins
e655e3c550 Update client.md 2020-06-04 23:52:32 +01:00
Iain Collins
6ea00f44dd Update example for session() 2020-06-04 23:10:29 +01:00
Seva Maltsev
843c258dd3 Update client.md (#204)
Added example of using session for api routes
2020-06-04 16:21:46 +02:00
Iain Collins
c6c94b1805 Remove oudated information from CONTRIBUTING.md 2020-06-03 22:06:59 +01:00
Iain Collins
315d75e40b Fix bug parsing hostname from database URL
Resolves #200
2020-06-03 22:01:37 +01:00
Iain Collins
f8bfe0c613 Fix bug linking accounts when using JWT with Mongo
Resolves #198
2020-06-03 18:31:06 +01:00
Iain Collins
50b9743bb6 HOTFIX for incorrect params to createSession
Resolves #197
2020-06-03 09:14:51 +01:00
Iain Collins
9c9abf19a3 Update introduction.md 2020-06-03 05:02:27 +01:00
Iain Collins
51f9f6fe6f Update contributors.md 2020-06-03 04:59:12 +01:00
Iain Collins
0c2c4cab69 Add JWT docs and update other docs 2020-06-03 04:41:43 +01:00
Iain Collins
ceb35cd036 Add JWT session support
* Now has jwt and jwtSecret options
* Set jwt: true to use JWT instead of DB for session
* Enable 'debug: true' to log JWT_SESSION_TOKEN to console if you want to see what it contains
* Magical!
2020-06-03 04:41:43 +01:00
Iain Collins
f9d0719ec4 Fix sessionExpiry on updateSession 2020-06-03 04:41:43 +01:00
Iain Collins
40f36e5ee9 Improve note on client API docs 2020-06-01 18:30:33 +01:00
Iain Collins
e9903d5391 Add documentation about provider client method 2020-06-01 18:22:27 +01:00
Gerald Nolan
a5bc38e61c Updated apple.md (#194)
Convert .k8 to single line to use as environment variable
Added additional comments on how to generate local certificate/edit host file
2020-06-01 19:19:57 +02:00
Iain Collins
6df7322493 Fix bug in Apple provider 2020-06-01 17:48:06 +01:00
Iain Collins
0495057458 Fix bug in VerificationRequest schema 2020-06-01 17:48:06 +01:00
Iain Collins
8a2ee7cbce HOTFIX CSS on signin page in Chome 2020-06-01 13:33:52 +01:00
Iain Collins
a465e2cda8 Improve styling on built-in pages
Improved font usage and button apperance.
2020-06-01 13:24:11 +01:00
Iain Collins
81c22f81ca Bump beta version number 2020-06-01 12:24:45 +01:00
Jibin George
4e4457f3ce Typo fix 2020-06-01 12:23:14 +01:00
Iain Collins
e993bc4f2a Bump beta version number 2020-06-01 04:03:44 +01:00
Iain Collins
c4fe49b0af Update Apple and Email provider docs 2020-06-01 04:03:44 +01:00
Iain Collins
5f211c8d0a Update advanced and basic options docs 2020-06-01 04:03:44 +01:00
Iain Collins
3e41381a52 Update next auth client documentation 2020-06-01 04:03:44 +01:00
Iain Collins
93488846e2 Refactor check-email page as verify-request
This allows the API surface to be more consistent
2020-06-01 04:03:44 +01:00
Iain Collins
9609d44638 Tell ESLint to ignore docs theme files 2020-06-01 04:03:44 +01:00
Iain Collins
59403ec607 Refactor Apple provider to genereate secret dynamically
See #176
2020-06-01 02:20:29 +01:00
Iain Collins
5f0f403b50 Refactor emailVerification to verificationRequest
Changes to verification model mean it can be used for other kinds of verification requests when credentials flow is implemented.

e.g. can support verification via SMS or an app.

Also includes minor update to account model.
2020-06-01 01:54:13 +01:00
Iain Collins
fdae191116 Fix linting and minor bug in client 2020-06-01 01:54:13 +01:00
Iain Collins
15424d2d03 Fix bug with callbackUrls not being passed to custom pages 2020-06-01 01:54:13 +01:00
Iain Collins
9d2d7133a1 Bump beta version number 2020-06-01 01:06:44 +01:00
Iain Collins
f50013899a Preserve callback URL on custom signin and signout pages 2020-06-01 01:06:44 +01:00
Iain Collins
beb2d08260 Add signin and signout methods to client
* Using method preserves current URL on signin / signout
* Reloads browser window once complete to force session update

The force reload behaviour may change to something more graceful in future, but is good for now as ensure page state is correct.
2020-06-01 01:06:44 +01:00
Iain Collins
b39d491df3 Rename tests dir to test (more conventional) 2020-06-01 01:06:44 +01:00
Iain Collins
7560d4ba80 Add new methods to client 2020-06-01 01:06:44 +01:00
Iain Collins
e90244b167 Adding to documentation
* Added REST API docs to sidebar
* Added documentation for the Apple Provider (WIP)
* Added clarity to documentation of options
* Added links to footer
2020-05-31 16:16:28 +01:00
Jibin George
a72aef7a86 clientSecret is required for Auth0
Seems like `clientSecret` is mandatory for Auth0 Provider.
2020-05-31 16:14:47 +01:00
Iain Collins
39e97c3b96 Restructure and extend documentation
Includes some minor tweaks to options to match documentation (non breaking changes).
2020-05-31 05:15:39 +01:00
Jibin George
e7d7a7ccab update 2020-05-30 19:41:25 +01:00
Jibin George
8b173efe96 Fix Provider component import path 2020-05-30 19:41:25 +01:00
Gerald Nolan
f53a7f3b85 Fixed Lint Issues 2020-05-27 14:30:15 +01:00
Gerald Nolan
62f5d7ebe1 Refactor -> Remove oauth-apple 2020-05-27 14:30:15 +01:00
Gerald Nolan
fd6fceb884 Sign In with Apple 2020-05-27 14:30:15 +01:00
Lori Karikari
74a5f459f5 Some cleanup (#173)
* shortened some long urls

* some fixes in text
2020-05-26 22:22:05 +02:00
Nico Domino
7b38af81cf Update README - Fix Typos 2020-05-26 21:48:25 +02:00
Iain Collins
401df2c177 Update Getting Started guide 2020-05-26 19:44:13 +01:00
Iain Collins
ffd9691cd0 Update docs for database and secret options 2020-05-26 19:44:13 +01:00
Iain Collins
e7ae32f618 Update www/docs/configuration.md 2020-05-26 19:39:28 +01:00
ndo@ndo1
97fadb0d9f fix: cleanup code example 2020-05-26 19:39:28 +01:00
ndo@ndo1
86f072bf4b add: docs for custom signin page 2020-05-26 19:39:28 +01:00
Iain Collins
981984b562 Improve database URI handling
* Fix bug in parser (.query -> search)
* Comments to explain what is going on
* Fallback to TypeORM parser
2020-05-26 17:48:04 +01:00
Iain Collins
1e9053d879 Add support for passing URL to 'database' option
* Database configuration now only needs a single line!
* You can still specify options using query string parameters.
* You can still specify an object, so this is not a breaking change.
2020-05-26 13:19:47 +01:00
Iain Collins
cb1ce73c92 Update title of documentation homepage 2020-05-26 13:19:47 +01:00
Iain Collins
93054578c9 Update README.md 2020-05-26 02:08:03 +01:00
Iain Collins
d112800b98 Add custom pages
Now supports 'pages' option, which can be any URL.

If specified, these replace the built in pages.

Example usage:

pages: {
  signin: 'https://example.com/signin',
  signout: 'https://example.com/signout',
  checkEmail: 'https://example.com/check-email',
  error: 'https://example.com/error'
}
2020-05-26 01:02:02 +01:00
Iain Collins
c8bf342d8b Fix sqlite support 2020-05-25 21:43:50 +01:00
Iain Collins
63ceb1a260 Don't lookup session if session token empty 2020-05-25 21:24:45 +01:00
Iain Collins
ca519b69ce Fix schema and queries for mongodb 2020-05-25 21:24:45 +01:00
Iain Collins
2f16d8448d Fix issues with database; make it easier to test
These changes fix compatibility issues with common SQL databases including MySQL, MariaDB and Postgres.

* Fixes #147 - datetime now ANSI SQL timestamp
* Fixes #160 - AccessToken and RefreshToken type change from varchar to text
* Adds Docker Compose files to make it easier to test database integration.

TODO:

* Update documentation with configuration examples and latest compatibility info
* Create DB URI parser (currently only object config works)
* Database table/collection name prefix (will default to `next-auth_`)
* MongoDB support

MongoDB has some issues which mean it will require additional work and refactoring to support (while preserving SQL DB support, which is important).

It's going to take some thinking about to get right; MongoDB support might have to be dropped from 2.0 (and follow in a subsequent release) but I'm going to review options and consider the impact before making a call.
2020-05-25 18:15:33 +01:00
Iain Collins
74b334f7ad Fix default exports in entrypoints
Resolves #157
2020-05-25 12:11:35 +01:00
Lachlan Campbell
d5a231f51b Fix typos: directory is called “pages” (#155) 2020-05-24 17:28:55 +02:00
ndo@ndo3
9b24e216fa fix: import statement typo 2020-05-23 17:31:19 +02:00
Lori Karikari
a944870eb2 changed options to params (#154) 2020-05-23 16:32:44 +02:00
Iain Collins
bc6fd4aa32 Bump version number to beta 43 2020-05-23 03:56:54 +01:00
Iain Collins
4a00d5aca5 Fix error when missing email in profile
* Fixes #145
* See also #131

This doesn't allow signing in without an email address, but it handles it gracefully.
2020-05-23 03:55:41 +01:00
Iain Collins
c55cb526f7 Update about.md 2020-05-23 01:56:31 +01:00
Iain Collins
70a728f15b Update documentation 2020-05-23 01:51:31 +01:00
Iain Collins
e7c9c844dc Update document site (#149) 2020-05-23 00:14:26 +02:00
Iain Collins
cf8e6980be Simplify database configuration
* Now accepts 'database' as an option as an alterantive to 'adapter'.
* If specified, 'database' can be a string or object and will load the default adapter.
* The 'adapter' option is still valid, and overrides the 'database' option.

 If neither option is specified, displays console error and web error page.
2020-05-21 20:51:58 +01:00
Iain Collins
7cd537d58d Customise website theme and homepage 2020-05-21 20:21:56 +01:00
ndo@ndo3
7ad11f73cd fix: quick typo 2020-05-21 12:34:43 +02:00
Nico Domino
82ac943e3e update: docs formatting / spelling / small stuff (#138) 2020-05-20 22:26:38 +02:00
Iain Collins
420bb9a74c Fix default session expiry time
Due to typo, was setting default expiry time to 30 hours, instead of 30 days.

This also made update session  behave incorrectly.
2020-05-20 18:39:28 +01:00
Iain Collins
4c32727b37 Refactor urlPrefix as baseURL
The name baseURL (and basePath) are exposed as options.

As they are more more widely used than urlPrefix and pathPrefix I've renamed them globally.
2020-05-20 18:39:28 +01:00
Iain Collins
339f618685 Refactor urlPrefix as baseURL
The name baseURL (and basePath) are exposed as options.

As they are more more widely used than urlPrefix and pathPrefix I've renamed them globally.
2020-05-20 18:10:37 +01:00
Lori Karikari
2a8337e67c Provider docs cleanup (#135)
* some initial cleanup

* cleaned up the config table

* added FB and fixed some alignments
2020-05-19 20:54:52 +02:00
Iain Collins
bd50714759 Merge branch 'master' of github.com:iaincollins/next-auth 2020-05-19 18:38:43 +01:00
Iain Collins
db9ef09d1d Fix edit URL in docs 2020-05-19 18:38:36 +01:00
Merijn
3bb4e0ca6f Fix parameter params 2020-05-19 14:16:47 +01:00
Iain Collins
b4886295ac Rename compound id field in account model
This constraint provides a cross-platform way of enforcing that a given oAuth account can only be associated with a single user, while allowing a user to link multiple oAuth accounts (and use any account they own to sign in).
2020-05-19 03:37:27 +01:00
Iain Collins
ef455dcf06 Add more information to contributing guide
Added the detailed steps on to set up an environment locally from #105
2020-05-19 02:39:28 +01:00
Iain Collins
5afa4f6e2b Refactor adapter logic
* Refactored adapter, with less redundant logic
* Removed logic from models
* Added email verification expiry support (defaults to 24 hours)
* Refactored session expiry handling and unified it with how email expiry works
* Default session expiry is still 30 days
* Now only updates expiry for a session at most once every 24 hours by default, to reduce writes to database
* Email verification max age, session max age and how often sessions are updated (to reduce database writes) are all simple options now
* Invalid sessionTokens are now deleted from the client
* Email verfication messages are now deleted once used (or when expired)
* Debug output is now an option (set `debug: true` to enable)
* Removed confusing options / callback from default adapter (except for passing in custom models/schemas)
* Adapter can now access all next-auth options, to make configuration easier
2020-05-19 02:08:10 +01:00
Iain Collins
50678d73bd Allow sessionToken cookie options to override defaults
This makes it possible to configure  session tokens to be deleted when the browser window is closed if desired.

Session expiry can now be treated as an optional field (but is always set and enforced by default).
2020-05-18 19:04:36 +01:00
Iain Collins
6d7066e4db Fix bug in session route
Accidentally included set cookie of a conditional it needs to be in.
2020-05-18 18:03:26 +01:00
Iain Collins
52eb11b385 Add session expiry logic
* By default, sessions are 30 day 'rolling sessions' and the timestamp for when they expire is extended when they are accessed to keep them alive.
* When sessions expire (ie after 30 days of inactivity), session object returns empty (as if there is no session) and users must sign in in again.
* Cleaning up old sessions from the database is not currently handled by the default adapter, but I do intend to add some logic to do this (added @TODO).
* The session expiry date can be changed by passing a custom updateSession() callback handler function in the options to the default adapter.

Using a custom `updateSession()` method with the default adapter, it is possible to specify other behaviour:

e.g.

* Disable rolling sessions (e.g. force a new login every X days).
* Create a session expiry date far into the future on initial sign in, so that they effectively never expire.
* Set a decently long max expiry time (e.g. 90+ days) but only actually update the session expiry time if the current expiry time is < 30 days; so that sessions stay valid for 30 days (and at most 90 days of inactivity) so that idle sessions are valid for at least 30 days (and maybe longer) but you don't need to write to your session database as often (useful if slow/expensive).

Note: Adapter options are passed as second option to the default adapter (the first option being the DB connection details). This is probably confusing and might be a design mistake.

const adapter = Adapter.Default({ /* database object * /}, {
  updateSession: async (session, isNewSession) => {
    // 1st arg is the current session (or null) so it's easy to check current
    // expiry date, get user specific info, etc.
    // 2nd arg is true if this is a brand new session.
    //
    // Function should return an ISO date (e.g. toISOString) or false/null to
    // prevent an update from being applied; but should always return a session
    // if isNewSession is set or the sign in will fail.
  }
})

Relying on on Adapter options is a little obtuse / confusing and so I'm considering it an 'advanced option' right now. In future, we might change how session expiry dates and behaviour is set to make it easier.

Note: There are some other updates in this PR, that's just from the linter and some improvements to formatting of contributing guide.
2020-05-18 17:49:32 +01:00
Nico Domino
b176c15405 Docs - Add search (#129) 2020-05-18 15:10:40 +02:00
Iain Collins
021fdbcf1b Update contributing docs 2020-05-18 09:15:02 +01:00
Lori Karikari
d7d9988cd8 Add auth0 (#126)
* added Auth0 and updated docs

* changed to proper Auth0 urls
2020-05-17 23:28:18 +02:00
Nico Domino
e8baee1774 Another Docs Update (#124) 2020-05-17 23:21:14 +02:00
Lori Karikari
79179dad71 added Auth0 and updated docs (#125) 2020-05-17 23:21:02 +02:00
Iain Collins
c8de8a1182 Fix editUrl in docs
I think I broke this earlier by mistake
2020-05-17 22:08:14 +01:00
ndo@ndo3
a2cfcef0aa update: docs site 2020-05-17 22:05:27 +01:00
Lori
28d220a42b added Facebook 2020-05-17 20:57:16 +01:00
Iain Collins
26a8b20459 Bump version number
Debugging issue with deployment of docs site.
2020-05-17 20:42:16 +01:00
Iain Collins
84e0ddf241 Fix issue with docusaurus config on now.sh
Although previous config worked locally, it turns out it isn't compatible with now.sh.

It turns out when deploying from a subdir (like 'www') on now.sh the contents of the parent directory isn't avalible.
2020-05-17 20:30:56 +01:00
Iain Collins
6e3a6ba287 Update docs and website dir structure
* Now has 'www' directory at root level for the website (was 'docs').
* The 'docs' directory now only contains Markdown docs.
* Docusarus config looks in '../docs' for the docs.

This is deployed with now.sh to https://next-auth-docs.now.sh
2020-05-17 20:13:54 +01:00
Nico Domino
d6e7b09ff7 Update docusaurus.js to work with now.sh again 2020-05-17 19:01:50 +02:00
Iain Collins
daca296df4 Remove .vscode dir I commited by mistake 2020-05-17 17:49:24 +01:00
Iain Collins
dbab5a3505 Refactor to remove oauth cruft
Removed unesseary branching for unused oauth code.
2020-05-17 17:45:00 +01:00
Iain Collins
8aa4045651 Force email to lowercase in all flows 2020-05-17 17:45:00 +01:00
ndo@ndo3
eb9561edab chore: cleanup markdown + CNAME 2020-05-17 17:45:00 +01:00
ndo@ndo3
332182a67f add: CNAME 2020-05-17 17:45:00 +01:00
ndo@ndo3
d7a2cde57e update: sidebar labels 2020-05-17 17:45:00 +01:00
ndo@ndo3
bb04645a93 update: package.json 2020-05-17 17:45:00 +01:00
ndo@ndo3
d25493ae79 add: docusaurus docs 2020-05-17 17:45:00 +01:00
Lori
8522628a11 removed incomplete custom email, added some more links and cleanup 2020-05-17 17:45:00 +01:00
Lori
875ecaeb06 first draft 2020-05-17 17:45:00 +01:00
Iain Collins
25c83b2914 Update session.js 2020-05-17 17:45:00 +01:00
Iain Collins
8a516904b8 Force email to lowercase in all flows 2020-05-17 17:45:00 +01:00
Iain Collins
df4c71496b Fix bugs with sign in flow and error handling 2020-05-17 17:45:00 +01:00
Iain Collins
026bef6f60 Improve error handling
* Better error handling, more specific messages.
* Async email option has been removed as was problematic on serverless.
* Refactored email sign in so that sending emails is now handled by the email provider.
* How email configuration works is now more customimzable - and cleanly seperated from  database logic.
* Now possible to define logic for async email (e.g. pass messages to a queue) or use any email provider or API.
2020-05-17 17:45:00 +01:00
Iain Collins
2b168e183b Improve error messages 2020-05-17 17:45:00 +01:00
Iain Collins
c86ea5e9dc Refactor sign in; make async email optional
* Email providers can now set  the option 'async' to 'true' to send emails AFTER displaying confirmation page, or to 'false' send emails BEFORE returning to the user. Defaults to false.

Setting it to true is faster for the user, but is hard to debug as it's not easy to know if it worked or not.

* Fixed bug with unsubscribe option.

* Moved oAuth and Email signin handlers together in `lib` dir.
2020-05-17 17:45:00 +01:00
Iain Collins
966577fc02 Improve email sign in flow 2020-05-17 17:45:00 +01:00
Iain Collins
d0d3af5f12 Bump version to beta 23 2020-05-17 17:45:00 +01:00
Iain Collins
c62617532f Improve email sign in (email, error, options) 2020-05-17 17:45:00 +01:00
Iain Collins
fc28374f88 Add email sign in flow
* Added email verification adapater methods
* Added support on sign in page for email providers
* Added check email page
* Added SMTP transport to send email messages

Includes refactoring of model and handlers for the email verification flow.
2020-05-17 17:45:00 +01:00
Iain Collins
6ec9d8e9d0 Rename deleteUserById to and getUserById
Brings them into line with other methods.

Not refactoring other getUser* methods at this time as may be helpful for them to be explicit about what will be passed.
2020-05-17 17:45:00 +01:00
Iain Collins
26d41d4a2b Refactor session API in adapter
* Renamed 'Session ID' to 'Session Token'.
* Applies to model, functions and default cookie name.
* This avoids confusion by seperating it from 'id' property in session model.
2020-05-17 17:45:00 +01:00
Iain Collins
b6c2befba7 Add verification request methods to adapter 2020-05-17 17:45:00 +01:00
Iain Collins
0d96a7e9e5 Rename Invite model to Verify 2020-05-17 17:45:00 +01:00
Iain Collins
3006161bce Documentation and linting updates
* Updated documentation
* `lint` and `lint:fix` now seperate scripts
* Fixed simple linting issues

Still some linter errors as the email sign up flow is a work in progress.
2020-05-17 17:45:00 +01:00
Lori Karikari
c653a1cc72 Added Mixer, Discord, Slack and Reddit (partially) (#111)
* added a temporary? state param
* added Discord, Mixer, Slack and partial Reddit providers

Co-authored-by: Iain Collins <me@iaincollins.com>
2020-05-17 17:45:00 +01:00
Iain Collins
301f048ce3 Signup bug fixes and enhancements
* Improve CSRF token verification
* Improved access token generation
* Added work in progress code for email signin provider
2020-05-17 17:45:00 +01:00
Iain Collins
3ac6666bee Additional debugging in oAuth callback
Logs provider name and code / token when access token request fails.
2020-05-17 17:45:00 +01:00
Iain Collins
73a5be5d6c Fix for breaking changes in Twitch API
Twitch recently made breaking changes to their oAuth API.

It no longer works like other oAuth 2 providers. The documentation for it is extensive, but poor quality.

This update still has intermittant problems, but as far as I can make out  the problem is the API; they have completed their roll out to 100% but it's still failing sometimes.
2020-05-17 17:45:00 +01:00
Iain Collins
ed6328679a Improve client
* Improve options passing
* Fix bug with cookie parsing
* Remove isomorphic-unfetch (fetch built from Next.js 9.4)
2020-05-17 17:45:00 +01:00
Iain Collins
8eb9c4822e Bump version to beta 16 2020-05-17 17:45:00 +01:00
Iain Collins
8a9e2305c8 Fix typo in comment 2020-05-17 17:45:00 +01:00
Iain Collins
7ef2a2ec93 Add eslint with Standard JS and reformat code
* Run `npm run lint` to find (and where possible, fix) linting issues.
* Includes some minor refactoring, including directory structure for adapters and models, so that code for an adapter and the models for it sit together.

Background:

I've added elint to try and ensure a consistent style and to uncover hidden bugs.

I don't actually care much about what the rules are, it's just helpful to have a baseline.

If it's hard to get code to be compliant, I would rather we just disable a rule in that block of code until we can figure it out and am totally fine with that.

I'd much prefer that than the chore of maintaining a custom set of rules, which is why I just picked Standard JS.

Unfortunately, there is quite a lot that doesn't match the Standard JS format at this point, so this is going to be a big PR.

The file size has gone down in quite a few places, which is nice. I think it may have uncovered potential bugs.

I've run through the flow and everything seems to work as before, though it took some debugging after refactoring.

I have not yet added eslint to a commit hook and am in two minds about that.

This is an open source project and I'd like to make it easy to maintain, but also to have as low a barrier to entry as possible for contributors.

I'm happy to go with encouraging folks to run the linter and try to fix errors they find and to take on the work of wrangling any issues myself.
2020-05-17 17:45:00 +01:00
Fredrik Pettersen
67d49fe483 refactor: Combine useSession and useGlobalSession into one hook 2020-05-17 17:45:00 +01:00
Fredrik Pettersen
cc2753efd5 feat(client): Add useGlobalSession which uses react context 2020-05-17 17:45:00 +01:00
Iain Collins
d0a403e56a Improve auth page CSS 2020-05-17 17:45:00 +01:00
Iain Collins
ab9d1d0a91 Add log and error page to handle signup errors
This error page will be used to handle display all errors to the client.

There will be an option to provide a custom error page URL.

Update includes some tweaks to CSS.
2020-05-17 17:45:00 +01:00
Iain Collins
c85ad74508 Fix bug with session expiry date
* Should database compatability issues with the model.
* Session expiry dates are still not enforced in client.
* All cookies are still sesison cookies and expire when the browser is closed.
* AccessToken expiry has been removed for now.

These are all know issues and intended behaviour for now, and will be addressed before release.
2020-05-17 17:45:00 +01:00
Iain Collins
2dca9308e9 Delete .DS_Store
<<< .DS_Store rage intensifies >>>
2020-05-17 17:45:00 +01:00
Iain Collins
494a267527 Fix typo import twitch provider
This worked locally as local file system is not case sensitive.
2020-05-17 17:45:00 +01:00
Iain Collins
4c163d54ca Fix bug with callback URL triggered on signout
In some flows the signout values was returning 'undefined'.
2020-05-17 17:45:00 +01:00
Iain Collins
b9853b362b Export Twitch provider
I haven't had a chance to test it myself yet, but very happy to include it!
2020-05-17 17:45:00 +01:00
Lori
121e978d76 added Twitch provider 2020-05-17 17:45:00 +01:00
Iain Collins
b9142217a9 Refactor callback URL handler
Less code in one place and less code overall.
2020-05-17 17:45:00 +01:00
Iain Collins
74d67dd801 Refactor callback URL handling
* Logic now centralized to avoid duplicaiton across multiple routes.
* Improved validation of query params.
* Also checks and cookie values as mitigation against cookie hijacking.
2020-05-17 17:45:00 +01:00
Iain Collins
121ed4a58e Add deleteSessionById() so signing out works
Can now securely sign out. Session cookie and entry in session db are deleted.
2020-05-17 17:45:00 +01:00
Iain Collins
cf903ca82e Add route to handle signout POST
* CSRF token is verified first.
* If token doesn't match, redirect client to signout URL to prompt for confirmation.
* `deleteSessionById()` not yet implemented in default adapter, so does not work.
* Identified area for reafactoring around callbackUrl behaviour.
2020-05-17 17:45:00 +01:00
Iain Collins
2f61795697 Add verification of URL prefix cookie
Improves security and defence against bad actors by adding a hash that uses the secret as a salt and checking it on every request (and overriding the cookie with a new secure one if the check fails.)
2020-05-17 17:45:00 +01:00
Iain Collins
d5257fe1db Add signout page
This commit does not include handling of actual signout request.
2020-05-17 17:45:00 +01:00
Iain Collins
822fbee0c4 Fix bugs with server side session handling
* Sets site name + api route now prior to sign in so avalible sooner.
* Improved next-auth/client logic for server side session handling.
* next-auth/client now checks regular and `__Secure-` prefixed cookies.
2020-05-17 17:45:00 +01:00
Iain Collins
937f9cdfda Fix case sensitivy of prefix for secure cookies 2020-05-17 17:45:00 +01:00
Iain Collins
2bb9355933 Improve signin page
* Better contrast
* Displays site name correctly
2020-05-17 17:45:00 +01:00
Iain Collins
57a9021107 Add route to return CSRF token to clients 2020-05-17 17:45:00 +01:00
Iain Collins
71fecfb1f2 Standardize done() call for routes 2020-05-17 17:45:00 +01:00
Iain Collins
1b374817f0 Improve and standardize how responses are returned
Use .status() and .json() where possible.
2020-05-17 17:45:00 +01:00
Iain Collins
eee927a6cd Add CSRF token and improve cookie security
Better default security for cookies, without impacting UX or DX.

Further work to do on CSRF protection, but this is a good start.
2020-05-17 17:45:00 +01:00
Iain Collins
0fabfa4ef9 Add viewport metatag to pages for mobile devices 2020-05-17 17:45:00 +01:00
Iain Collins
57bf54c28d Fix useEffect() warning in client
Technically useEffect should not return a value, or generates a warning.
2020-05-17 17:45:00 +01:00
Iain Collins
9bbc9100ab Update documentation 2020-05-17 17:45:00 +01:00
Iain Collins
e6cd78d71b Bump version number to publish new README 2020-05-17 17:45:00 +01:00
Iain Collins
3d66b90cf8 Update README.md 2020-05-17 17:45:00 +01:00
Iain Collins
ebfb02bd12 Bump version number to update docs 2020-05-17 17:45:00 +01:00
Iain Collins
2032ff1276 Update README 2020-05-17 17:45:00 +01:00
Iain Collins
08582aad83 Fix bugs with parsing options
Some of the logic was wrong following refactoring.
2020-05-17 17:45:00 +01:00
Iain Collins
c9944820c6 Fix bug in client session method
Introduced when refactoring error handling
2020-05-17 17:45:00 +01:00
Iain Collins
0697609dd0 Add beta tag to version
While it is still somewhere between an alpha and a beta am publishing to NPM to facilitate further testing.

The software is not ready for use yet!

While belived to be functional there are no formal tests and only casual manual testing has been done.

Features such as logout and session expiry checks have not yet been implemented.
2020-05-17 17:45:00 +01:00
Iain Collins
39d3689c22 Improve client error handling 2020-05-17 17:45:00 +01:00
Iain Collins
43023293ea Remove install script
No longer needed.
2020-05-17 17:45:00 +01:00
Iain Collins
91f319bc5f Add script to run build after install
This is to temporarily facilitate testing.
2020-05-17 17:45:00 +01:00
Iain Collins
f847488643 Improve error handling in client 2020-05-17 17:45:00 +01:00
Iain Collins
731e227cb6 Update babel config 2020-05-17 17:45:00 +01:00
Iain Collins
f2aafac40c Update formatting in README.md 2020-05-17 17:45:00 +01:00
Iain Collins
5bff4cb07f Add hook, improve client, cookies and docs
* Added React Hook to client.
* NextAuth.session() is now a universal method.
* Improved cookie support, all cookie names and options can be customised (feature request).
* Updated examples in documentation.
2020-05-17 17:45:00 +01:00
Iain Collins
06ef47cc40 Update client and documentation
This is very much a work in progress!
2020-05-17 17:45:00 +01:00
Iain Collins
3e0e4ecb5d Add simple client 2020-05-17 17:45:00 +01:00
Iain Collins
651f3c9887 Improve session and account linking 2020-05-17 17:45:00 +01:00
Iain Collins
cfbe24fc24 Add sessions
While not all signup flows are complete, basic core functionality is now working.

Users can sign in, have their identify verified and session is created for them in a secure manner.

* Added Session model and schema.
* Added createSession and getSessionByID handlers.
 * Added getUserByID handler.
 * Added /api/auth/session endpoint which displays info about the current session.
 * /api/auth/session endpoint is secure as it requires the HTTP only cookie.
 * Remove schema relationship data for now (no value currently and may cause problems if not modeled correctly).
2020-05-17 17:45:00 +01:00
Iain Collins
9432cfda90 Add Preact and PostCSS for pages
We need to be able to return simple server-side rendered pages for authentication (e.g. signin).

Using Preact means we can use JSX in them while keeping depedancy size small.

Ultimately, these pages should be customizable - both by passing in CSS and by specifying custom URL for page.

Additionally, the babel config has been tweaked to reduce bundle size by minifying assets and stripping comments from built assets.
2020-05-17 17:45:00 +01:00
Iain Collins
981adaae24 Update README.md 2020-05-17 17:45:00 +01:00
Iain Collins
ec3da81887 Add option to extend models / use custom models 2020-05-17 17:45:00 +01:00
Iain Collins
d150a7911c Update documentation 2020-05-17 17:45:00 +01:00
Iain Collins
018738bcc0 List files to be published to NPM in package.json 2020-05-17 17:45:00 +01:00
Iain Collins
e37e20faf5 Add babel config for esmodule
This allows next-auth to be imported into Node.js projects.
2020-05-17 17:45:00 +01:00
Iain Collins
4bf13394f1 Add database adapter and models
* Uses typeorm as works with a large number of data stores.
* Compatible with common SQL, document storage & lightweight databases.
* Adapter logic integrated into signup flow but not yet complete.
2020-05-17 17:45:00 +01:00
Iain Collins
3dad0cc849 Apply custom provider options after default
Makes it easier to override options as needed.
2020-05-17 17:45:00 +01:00
Iain Collins
ea69d1e904 Initial commit of signin flow
* Flow not fully complete or tested, but can complete signin journey.
* Does not include source code for adapter (test adapater source currently in client respository while under development).
* Wrapped all calls in promise to avoid early termination of serverless function.
* Callback and Session cookie names and cookie options can now be changed by passing options for them in (feature request from 1.x).
2020-05-17 17:45:00 +01:00
Iain Collins
b666cde7a7 Update README.md and configuration
* Renamed the `serverUrl` configuration variable to `site`.
* Improved cosmetic apperance of place holder sign in page.
2020-05-17 17:45:00 +01:00
Iain Collins
e3784bba9d Initial commit of next-auth 2.0
* Redesigned from the ground up for serverless!
* Doesn't require PassportJS or Express!
* Much simpler configuration!
* Interface exposed via single API endpoint.
* Supports both oAuth 1.x and 2.x services.
* Initial commit includes support for signing in with Twitter, Google and GitHub.

Code is functional, but not useable as adapter support (saving user information) is still in progress.

Still to come:

* Support for Facebook, email, and  credential authentication flows.
* Adapter support - will provide out of the box support for MongoDB, Elasticsearch and SQL with support for writing custom adapters in a similar style to version 1.x.
* Automated User Acceptance Tests for all auth flows.
* Example usage . In a change from version 1.x a demo will exist in a seperate repository to make it easier to get started.
2020-05-17 17:45:00 +01:00
1010 changed files with 91176 additions and 13087 deletions

11
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,11 @@
# Learn how to add code owners here:
# https://help.github.com/en/articles/about-code-owners
* @balazsorban44
.github @ThangHuuVu
/apps/ @lluia @ndom91 @ThangHuuVu
/docs/ @lluia @ndom91
/packages/ @ThangHuuVu
/packages/adapter-*/ @ndom91
/**/*test* @lluia
/**/*type* @lluia

4
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,4 @@
# https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository
open_collective: nextauth
github: [balazsorban44]

View File

@@ -0,0 +1,61 @@
name: Bug report
description: Report an issue so we can improve
labels: [triage]
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.
Thanks for taking the time to fill out this issue after reading/searching through the [documentation](https://next-auth.js.org) first!
Is this your first time contributing? Check out this video: https://www.youtube.com/watch?v=cuoNzXFLitc
### 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._
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.
# - type: dropdown
# attributes:
# label: Framework
# description: Which framework(s) is this issue related to?
# multiple: true
# options:
# - "Next.js"
# - "Other"
- type: textarea
attributes:
label: Environment
description: |
Run this command in your project's root folder and paste the result:
```sh
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:
required: true
- type: input
attributes:
label: Reproduction URL
description: A URL to a repository/code that clearly reproduces your issue. You can use our [`next-auth-example`](https://github.com/nextauthjs/next-auth-example) template repository to get started more easily, or link to your project if it's public
validations:
required: true
- type: textarea
attributes:
label: Describe the issue
description: Describe us what the issue is and what have you tried so far to fix it. Add any extra useful information in this section. Feel free to use screenshots (but prefer [code blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) over a picture of your code) or a video explanation.
validations:
required: true
- type: textarea
attributes:
label: How to reproduce
description: Explain with clear steps how to reproduce the issue
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: Explain what should have happened instead of what actually happened
validations:
required: true

View File

@@ -0,0 +1,122 @@
name: Bug report (Provider)
description: Create a provider-specific report
labels: [triage, providers]
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.
Thanks for taking the time to fill out this [Provider](https://next-auth.js.org/providers/overview) related issue!
Is this your first time contributing? Check out this video: https://www.youtube.com/watch?v=cuoNzXFLitc
### 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._
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)
- type: dropdown
attributes:
label: Provider type
description: Provider(s) this issue is related to
multiple: true
options:
- "Credentials"
- "Email"
- "Custom provider"
- "42 School"
- "Apple"
- "Asgardeo"
- "Atlassian"
- "Auth0"
- "Authentik"
- "Azure Active Directory"
- "Azure Active Directory B2C"
- "Battlenet"
- "Beyond Identity"
- "Box"
- "Bungie"
- "Cognito"
- "Coinbase"
- "Descope"
- "Discord"
- "Dropbox"
- "EVE Online"
- "Facebook"
- "FACEIT"
- "Foursquare"
- "Freshbooks"
- "FusionAuth"
- "GitHub"
- "GitLab"
- "Google"
- "Identity Server 4"
- "Instagram"
- "Kakao"
- "Keycloak"
- "Line"
- "LinkedIn"
- "Mailchimp"
- "Mail.ru"
- "Medium"
- "Naver"
- "Netlify"
- "Notion"
- "Okta"
- "OneLogin"
- "Osso"
- "Osu"
- "Patreon"
- "Pipedrive"
- "Reddit"
- "Salesforce"
- "Slack"
- "Spotify"
- "Strava"
- "Todoist"
- "Trakt"
- "Twitch"
- "Twitter"
- "Vk"
- "Wordpress"
- "WorkOS"
- "Yandex"
- "Zoho"
- "Zoom"
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
Run this command in your project's root folder and paste the result:
```sh
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:
required: true
- type: input
attributes:
label: Reproduction URL
description: A URL to a repository/code that clearly reproduces your issue. You can use our [`next-auth-example`](https://github.com/nextauthjs/next-auth-example) template repository to get started more easily, or link to your project if it's public
validations:
required: true
- type: textarea
attributes:
label: Describe the issue
description: Describe us what the issue is and what have you tried so far to fix it. Add any extra useful information in this section. Feel free to use screenshots (but prefer [code blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) over a picture of your code) or a video explanation.
validations:
required: true
- type: textarea
attributes:
label: How to reproduce
description: Explain with clear steps how to reproduce the issue
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: Explain what should have happened instead of what actually happened
validations:
required: true

View File

@@ -0,0 +1,78 @@
name: Bug report (Adapter)
description: Create an adapter-specific report
labels: [triage, adapters]
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.
Thanks for taking the time to fill out this [Adapter](https://next-auth.js.org/adapters/overview) related issue!
Is this your first time contributing? Check out this video: https://www.youtube.com/watch?v=cuoNzXFLitc
### 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._
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)
- type: dropdown
attributes:
label: Adapter type
description: Adapter(s) this issue is related to
multiple: true
options:
- "Custom adapter"
- "@auth/dgraph-adapter"
- "@auth/drizzle-adapter"
- "@auth/dynamodb-adapter"
- "@auth/drizzle-adapter"
- "@auth/fauna-adapter"
- "@auth/firebase-adapter"
- "@auth/kysely-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"
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
Run this command in your project's root folder and paste the result:
```sh
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:
required: true
- type: input
attributes:
label: Reproduction URL
description: A URL to a repository/code that clearly reproduces your issue. You can use our [`next-auth-example`](https://github.com/nextauthjs/next-auth-example) template repository to get started more easily, or link to your project if it's public
validations:
required: true
- type: textarea
attributes:
label: Describe the issue
description: Describe us what the issue is and what have you tried so far to fix it. Add any extra useful information in this section. Feel free to use screenshots (but prefer [code blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) over a picture of your code) or a video explanation.
validations:
required: true
- type: textarea
attributes:
label: How to reproduce
description: Explain with clear steps how to reproduce the issue
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: Explain what should have happened instead of what actually happened
validations:
required: true

View File

@@ -0,0 +1,22 @@
name: "Documentation"
description: Request to update or improve NextAuth.js documentation
labels: ["triage", "documentation"]
body:
- type: textarea
attributes:
label: What is the improvement or update you wish to see?
description: "Example: The `next-auth` docs are missing information about X."
validations:
required: true
- type: textarea
attributes:
label: Is there any context that might help us understand?
description: A clear description of any added context that might help us understand.
validations:
required: true
- type: input
attributes:
label: Does the docs page already exist? Please link to it.
description: "Example: https://next-auth.js.org/getting-started/introduction"
validations:
required: false

View File

@@ -0,0 +1,72 @@
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 💚

57
.github/ISSUE_TEMPLATE/6_typescript.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
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 💚

61
.github/ISSUE_TEMPLATE/7_question.yml vendored Normal file
View File

@@ -0,0 +1,61 @@
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 💚

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

34
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,34 @@
<!--
Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated!
Please fill out the information below to expedite the review and (hopefully)
merge of your pull request!
-->
> _NOTE_:
>
> - It's a good idea to open an issue first to discuss potential changes.
> - Please make sure that you are _NOT_ opening a PR to fix a potential security vulnerability. Instead, please follow the [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md) to disclose the issue to us confidentially.
## ☕️ Reasoning
<!-- What changes are being made? What feature/bug is being fixed here? -->
## 🧢 Checklist
- [ ] Documentation
- [ ] Tests
- [ ] Ready to be merged
## 🎫 Affected issues
Please [scout and link issues](https://github.com/nextauthjs/next-auth/issues) that might be solved by this PR.
Fixes: INSERT_ISSUE_LINK_HERE
## 📌 Resources
- [Security guidelines](https://github.com/nextauthjs/.github/blob/main/SECURITY.md)
- [Contributing guidelines](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md)
- [Code of conduct](https://github.com/nextauthjs/.github/blob/main/CODE_OF_CONDUCT.md)
- [Contributing to Open Source](https://kcd.im/pull-request)

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,653 @@
@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.

445
.github/actions/issue-validator/package-lock.json generated vendored Normal file
View File

@@ -0,0 +1,445 @@
{
"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

@@ -0,0 +1,14 @@
{
"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

@@ -0,0 +1,37 @@
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 closed after 7 days.
If your issue has _not_ been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction. (It's less likely that we check back on already closed issues.)
### **I did not open this issue, but it is relevant to me, what can I do to help?**
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

@@ -0,0 +1,91 @@
// @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) 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(
"/home/runner/work/next-auth/next-auth/.github/actions/issue-validator/repro.md"
),
"utf8"
),
}),
])
return core.info(
"Commented on issue, because it did not have a sufficient reproduction."
)
}
} catch (error) {
core.setFailed(error.message)
}
}
run()

49
.github/issue-labeler.yml vendored Normal file
View File

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

27
.github/pr-labeler.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
# https://github.com/actions/labeler#create-githublabeleryml
adapters: ["packages/core/src/adapters.ts", "packages/adapter-*/**/*"]
core: ["packages/core/src/**/*"]
dgraph: ["packages/adapter-dgraph/**/*"]
documentation: ["packages/docs/docs/**/*"]
dynamodb: ["packages/adapter-dynamodb/**/*"]
examples: ["apps/examples/**/*"]
fauna: ["packages/adapter-fauna/**/*"]
firebase: ["packages/adapter-firebase/**/*"]
frameworks: ["packages/frameworks-*/**/*"]
legacy: ["packages/next-auth/**/*"]
mikro-orm: ["packages/adapter-mikro-orm/**/*"]
mongodb: ["packages/adapter-mongodb/**/*"]
neo4j: ["packages/adapter-neo4j/**/*"]
playgrounds: ["apps/playgrounds/**/*"]
pouchdb: ["packages/adapter-pouchdb/**/*"]
prisma: ["packages/adapter-prisma/**/*"]
kysely: ["packages/adapter-kysely/**/*"]
providers: ["packages/core/src/providers/**/*"]
sequelize: ["packages/adapter-sequelize/**/*"]
solidjs: ["packages/frameworks-solid-start/**/*"]
supabase: ["packages/adapter-supabase/**/*"]
svelte: ["packages/frameworks-sveltekit/**/*"]
test: ["**test**/*"]
typeorm: ["packages/adapter-typeorm/**/*"]
upstash-redis: ["packages/adapter-upstash-redis/**/*"]
xata: ["packages/adapter-xata/**/*"]

20
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
# https://github.com/probot/stale#usage
daysUntilStale: 60
daysUntilClose: 7
exemptLabels:
- pinned
- security
- priority
- bug
- triage
- accepted
staleLabel: stale
markComment: >
It looks like this issue did not receive any activity for 60 days.
It will be closed in 7 days if no further activity occurs. If you think your issue
is still relevant, commenting will keep it open. Thanks!
closeComment: >
To keep things tidy, we are closing this issue for now.
If you think your issue is still relevant, leave a comment
and we might reopen it. Thanks!

27
.github/sync.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
nextauthjs/sveltekit-auth-example:
- source: apps/examples/sveltekit
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE
nextauthjs/solid-start-auth-example:
- source: "apps/examples/solid-start"
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE
nextauthjs/next-auth-gatsby-example:
- source: apps/playgrounds/gatsby
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE
nextauthjs/next-auth-example:
- source: apps/examples/nextjs
dest: .
deleteOrphaned: true
- .github/FUNDING.yml
- LICENSE

8
.github/version-pr/action.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
name: "Determine version"
description: "Determines npm package version based on PR number and commit SHA"
outputs:
version:
description: "npm package version"
runs:
using: "node16"
main: "index.js"

22
.github/version-pr/index.js vendored Normal file
View File

@@ -0,0 +1,22 @@
const fs = require("fs")
const path = require("path")
const core = require("@actions/core")
try {
const packageJSONPath = path.join(
process.cwd(),
`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 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))
} catch (error) {
core.setFailed(error.message)
}

27
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Code Analysis
on:
push:
branches: [beta, next]
pull_request:
branches: [main]
schedule:
- cron: "43 17 * * 2"
jobs:
analyze:
name: Verify
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: ["javascript"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

18
.github/workflows/issue-labeler.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
# 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

17
.github/workflows/issue-validator.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
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 }}

16
.github/workflows/pr-labeler.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
# https://github.com/actions/labeler#create-workflow
name: Label Pull Requests
on:
pull_request_target:
jobs:
prs:
name: Triage
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: ".github/pr-labeler.yml"

212
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,212 @@
name: Release
on:
push:
branches:
- 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/nextjs"
- "@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-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:
name: Test
runs-on: ubuntu-latest
steps:
- name: Init
uses: actions/checkout@v3
with:
fetch-depth: 2
- 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: 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 }}
# - 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:
# directory: ./coverage
# fail_ci_if_error: false
release-branch:
name: Publish branch
runs-on: ubuntu-latest
needs: test
if: ${{ github.event_name == 'push' }}
environment: Production
steps:
- name: Init
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT_CLASSIC }}
- 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: Publish to npm and GitHub
run: pnpm release
env:
# Use GH_PAT when this is fixed:
# https://github.com/github/roadmap/issues/622
GITHUB_TOKEN: ${{ secrets.GH_PAT_CLASSIC }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release-pr:
name: Publish PR
runs-on: ubuntu-latest
needs: test
if: ${{ github.event_name == 'pull_request' }}
environment: Preview
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:
PR_NUMBER: ${{ github.event.number }}
- name: Publish to npm
run: |
cd packages/core
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
pnpm publish --no-git-checks --access public --tag experimental
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Comment version on PR
uses: NejcZdovc/comment-pr@v2
with:
message:
"🎉 Experimental release [published 📦️ on npm](https://npmjs.com/package/@auth/core/v/${{ env.VERSION }})!\n \
```sh\npnpm add @auth/core@${{ env.VERSION }}\n```\n \
```sh\nyarn add @auth/core@${{ env.VERSION }}\n```\n \
```sh\nnpm i @auth/core@${{ env.VERSION }}\n```"
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 }}

19
.github/workflows/sync-examples.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Sync Example Repositories
on:
push:
branches:
- main
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run GitHub File Sync
uses: balazsorban44/repo-file-sync-action@master
with:
GH_PAT: ${{ secrets.GH_PAT }}
IS_FINE_GRAINED: true
SKIP_PR: true
ORIGINAL_MESSAGE: true

107
.gitignore vendored
View File

@@ -1,3 +1,106 @@
.next
# Misc
.DS_Store
.eslintcache
.env
node_modules
.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
# Build dirs
.next
build
dist
# Generated files
.docusaurus
.cache-loader
packages/next-auth/providers
packages/next-auth/src/providers/oauth-types.ts
packages/next-auth/client
packages/next-auth/css
packages/next-auth/utils
packages/next-auth/core
packages/next-auth/jwt
packages/next-auth/react
packages/next-auth/next
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
/.vs/slnx.sqlite
/.vs
.vscode/generated*
# Jetbrains
.idea
# GitHub Actions runner
/actions-runner
/_work
# DB
dev.db*
packages/adapter-prisma/prisma/dev.db
packages/adapter-prisma/prisma/migrations
db.sqlite
packages/adapter-supabase/supabase/.branches
packages/adapter-drizzle/.drizzle
# Tests
coverage
dynamodblocal-bin
firestore-debug.log
test.schema.gql
# Turborepo
.turbo
# docusaurus
docs/.docusaurus
docs/providers.json
# Core
packages/core/src/providers/oauth-types.ts
packages/core/lib
packages/core/providers
packages/core/src/lib/pages/styles.ts
docs/docs/reference/core
docs/docs/reference/sveltekit
# SvelteKit
packages/frameworks-sveltekit/index.*
packages/frameworks-sveltekit/client.*
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*

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
18

67
.prettierignore Normal file
View File

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

8
.vscode/settings.json vendored Normal file
View File

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

14
.vscode/snippets.code-snippets vendored Normal file
View File

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

View File

@@ -1,85 +0,0 @@
# Authentication
To use oAuth you need to configure environment variables with ID and secret and configure the service accordingly.
This project comes pre-configured to handle Facebook, Google and Twitter oAuth if you provide the ID and sercret for the service via environment variables.
You can pass them on the command line or put them in `.env` file which will be loaded at startup (see [.env.example](https://github.com/iaincollins/next-auth/blob/master/example/.env.example) for an example).
If you want to add new oAuth providers (such as GitHub), you will need to:
* Add the oauth provider configuration in next-auth.providers.js
* Add a field to your User model (in 'index.js') with the name of the provider
* Configure the service to point to your website (as in the examples below)
* Specify the environment variables at run time
## Configuring your account
These guides are approximate as exactly how to configure oAuth varies for each provider and tends to change when they update their developer portals, which can be quite often. If you can't see the options mentioned, try exploring the UI in the developer portal or configuration pages.
Due to the volume of requests I'm not usually able to help with specific problems but pull requests with improved or extended instructions are very welcome.
Tip: Twitter's oAuth implementation is the most permissive and easiest to configure, you may want to start with it. If you run into problems, you might
want to check email sign-in is working as baseline.
Please note that Facebook oAuth cannot be used to sign in to 'localhost' and that if you want to sign in to `localhost` with Google+ you must specifically add something like `http://localhost:3000/auth/oauth/google/callback` as a authorized redirect URI for your application.
### Facebook Login
Environment variables:
* FACEBOOK_ID
* FACEBOOK_SECRET
Configuration steps:
1. Go to [Facebook Developers](https://developers.facebook.com/)
2. Click **Apps > Create a New App** in the navigation bar
3. Enter *Display Name*, then choose a category, then click **Create app**
5. Specify *App ID* as the **FACEBOOK_ID** Config Variable
6. Specify *App Secret* as the **FACEBOOK_SECRET** Config Variable
7. Click on *Settings* on the sidebar, then click **+ Add Platform**
8. Select **Website**
9. Enable 'Client OAuth Login' and 'Web OAuth Login'
10. list`http://your-server.example.com/auth/oauth/facebook/callback` under 'Valid OAuth redirect URIs'
11. List your sites domain under 'domains'
### Google+
Environment variables:
* GOOGLE_ID
* GOOGLE_SECRET
Configuration steps:
1. Visit [Google Cloud Console](https://cloud.google.com/console/project)
2. Click the **CREATE PROJECT** button, enter a *Project Name* and click **CREATE**
3. Then select *APIs* then *Credentials*
4. Select **Create new oAuth Client ID** and enter the following:
- **Application Type**: Web Application
- **Authorized Javascript origins**: `http://your-server.example.com/`
- **Authorized redirect URI**: `http://your-server.example.com/auth/oauth/google/callback`
5. Specify *Client ID* as the **GOOGLE_ID** Config Variable
6. Specify *Client Secret* as the **GOOGLE_SECRET** Config Variable
7. Enable Google+ on the project - if you don't, sign in with Google+ will fail!
### Twitter
Environment variables:
* TWITTER_KEY
* TWITTER_SECRET
Configuration steps:
1. Sign in at [https://apps.twitter.com](https://apps.twitter.com/)
2. Click **Create a new application**
3. Enter your application name, website and description
4. For **Callback URL**: `http://your-server.example.com/auth/oauth/twitter/callback`
5. Go to **Settings** tab
6. Under *Application Type* select **Read and Write** access
7. Check the box **Allow this application to be used to Sign in with Twitter**
8. Click **Update this Twitter's applications settings**
9. Specify *Consumer Key* as the **TWITTER_KEY** Config Variable
10. Specify *Consumer Secret* as the **TWITTER_SECRET** Config Variable

View File

@@ -1,6 +1,6 @@
ISC License
Copyright (c) 2018, Iain Collins
Copyright (c) 2022-2023, Balázs Orbán
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
@@ -12,4 +12,4 @@ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -1,95 +0,0 @@
# NextAuthClient
## About NextAuthClient
NextAuthClient is session library for the [next-auth](https://www.npmjs.com/package/next-auth) module.
## Methods
It provides the following methods, all of which return a promise.
### NextAuthClient.init({ req, force })
Isometric (can be used in server side rendering when passed optional `req` object).
Return the current session.
When using Server Side Rendering and passed `req` object from **getInitialProps({req})** it will read the data from it.
When using Client Side Rendering it will use localStorage (if avalible) to check for cached session data and if not found or expired it call the `/auth/session` end point.
### NextAuthClient.signin(string or object)
Client side only method.
If passed a string treats it as an email address, generates an email sign in token and makes POST request to `/auth/email/signin`.
If passed an object treats it as a form to be handled by a custom signIn() function and makes a POST request to `/auth/signin`.
### NextAuthClient.signout()
Client side only method. Triggers the current session to be destroyed.
Makes POST request to `/auth/signout`.
### NextAuthClient.csrfToken()
Client side only method. Returns the latest CSRF Token.
Note: When rendering server side, this is accessible from NextAuthClient.init().
Makes GET request to `/auth/csrf`.
### NextAuthClient.linked({ req })
Isometric method (can be used in server side rendering when passed optional `req` object).
Returns a list of linked/unlinked oAuth providers.
This is useful on account management pages where you want to display buttons to link / unlink accounts.
Makes GET request to `/auth/linked`.
### NextAuthClient.providers({ req })
Isometric method (can be used in server side rendering when passed optional `req` object).
Returns a list of all configured oAuth providers.
It includes their names, sign in URLs and callback URLs.
This is useful on sign in pages (e.g. to render sign in links for all configured providers).
Makes GET request to `/auth/providers`.
## Example
````javascript
import React from 'react'
import { NextAuth } from 'next-auth/client'
export default class extends React.Component {
static async getInitialProps({req}) {
return {
session: await NextAuth.init({req})
}
}
render() {
if (this.props.session.user) {
return(
<div>
<p>You are logged in as {this.props.session.user.name || this.props.session.user.email}.</p>
</div>
)
} else {
return(
<div>
<p>You are not logged in.</p>
</div>
)
}
}
}
````
See [next-auth](https://www.npmjs.com/package/next-auth) for more information or [nextjs-starter](https://nextjs-starter.now.sh) for a working demo.

324
README.md
View File

@@ -1,221 +1,153 @@
# NextAuth
<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>
## About NextAuth
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.
NextAuth is an authentication library for Next.js projects.
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).
The NextAuth library uses Express and Passport, the most commonly used authentication library for Node.js, to provide support for signing in with email and with services like Facebook, Google and Twitter.
## Features
NextAuth adds Cross Site Request Forgery (CSRF) tokens and HTTP Only cookies, supports universal rendering and does not require client side JavaScript.
### Flexible and easy to use
It adds session support without using client side accessible session tokens, providing protection against Cross Site Scripting (XSS) and session hijacking, while leveraging localStorage where available to cache non-critical session state for optimal performance in Single Page Apps.
- 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.)
The NextAuth comes with a client library, designed to work with React pages powered by Next.js to easily add universal session support to sites.
### Own your data
It contains an [example site](https://github.com/iaincollins/next-auth/tree/master/example) that shows how to use it in a simple project. It's also used in the [nextjs-starter.now.sh](https://nextjs-starter.now.sh) project, which provides a more complete example with a live demo.
Auth.js can be used with or without a database.
Note: As of version 1.5 NextAuth is also compatible non-Next.js React projects, just pass `null` instead of a nextApp instance when calling `nextAuth()`.
- 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
You will need to handle setting up routes before and after initialising NextAuth if you are not using Next.js. NextAuth lets you pass an instance of express as 'expressApp' option (and returns it in the response).
### Secure by default
## Example Client Usage
- 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)
````javascript
import React from 'react'
import { NextAuth } from 'next-auth/client'
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.
export default class extends React.Component {
static async getInitialProps({req}) {
return {
session: await NextAuth.init({req})
}
}
render() {
if (this.props.session.user) {
return(
<div>
<p>You are logged in as {this.props.session.user.name || this.props.session.user.email}.</p>
</div>
)
} else {
return(
<div>
<p>You are not logged in.</p>
</div>
)
}
}
}
````
### TypeScript
See [Documentation for the NextAuth Client](https://github.com/iaincollins/next-auth/blob/master/README-CLIENT.md) for more information on how to interact with the client.
Auth.js libraries are written with type safety in mind. [Check out the docs](https://authjs.dev/getting-started/typescript) for more information.
## Routes
## Security
NextAuth adds a number of routes under `/auth':
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.
* POST `/auth/email/signin` - Request Sign In Token
* GET `/auth/email/signin/:token` - Validate Sign In Token
* POST `/auth/signout` - Sign Out
* GET `/auth/csrf` - CSRF endpoint for Single Page Apps
* GET `/auth/session` - Session endpoint for Single Page Apps
* GET `/auth/linked` - View linked accounts for Single Page Apps
## Acknowledgments
All POST routes request must include a CSRF token.
[Auth.js is made possible thanks to all of its contributors.](https://authjs.dev/contributors)
CSRF, Session and Linked Account endpoints are provided for Single Page Apps.
<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>
Note: Session Tokens are stored in HTTP Only cookies to prevent session hijacking and protect against Cross Site Scripting (XSS) attacks. Only HTTP requests that originate from the original domain are able to read from them.
### Support
In addition, it will add the following routes for each oAuth provider currently configured:
We have an [OpenCollective](https://opencollective.com/nextauth) for individuals and companies looking to contribute financially to the project!
* GET `/auth/oauth/${provider}`
* GET `/auth/oauth/${provider}/callback`
* POST `/auth/oauth/${provider}/unlink`
<!--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-->
You can see which routes are configured and the callback URLs defined for them via this route:
## Contributing
* GET `/auth/providers`
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).
It will return a JSON object with the current oAuth provider configuration:
## License
````json
{
"Facebook": {
"signin": "/auth/oauth/facebook",
"callback": "/auth/oauth/facebook/callback"
},
"Google": {
"signin": "/auth/oauth/google",
"callback": "/auth/oauth/google/callback"
},
"Twitter": {
"signin": "/auth/oauth/twitter",
"callback": "/auth/oauth/twitter/callback"
}
}
````
Note: The `/auth` prefix is configurable via an option in the module, but it is currently hard coded in the client component, so you probably don't want to change it. It will be configurable in future releases.
## Getting Started
Create an `index.js` file in the root of your Next.js project containing the following:
````javascript
const next = require('next')
const nextAuth = require('next-auth')
const nextAuthConfig = require('./next-auth.config')
require('dotenv').load()
const nextApp = next({
dir: '.',
dev: (process.env.NODE_ENV === 'development')
})
nextApp.prepare()
.then(async () => {
const nextAuthOptions = await nextAuthConfig()
const nextAuthApp = await nextAuth(nextApp, nextAuthOptions)
console.log(`Ready on http://localhost:${process.env.PORT || 3000}`)
})
.catch(err => {
console.log('An error occurred, unable to start the server')
console.log(err)
})
````
You can add the following to your `package.json` file to start the project:
````json
"scripts": {
"dev": "NODE_ENV=development node index.js",
"build": "next build",
"start": "node index.js"
}
````
## Pages
You will need to create following pages under `./pages/auth` in your project:
* index.js Sign In and Link/Unlink accounts
* error.js If an authentication error occurs
* check-email.js 'Check your email' messsage
* callback.js Callback page; updates local session on sign in / sign out
You can [find examples of these](https://github.com/iaincollins/next-auth/tree/master/example) included which you can copy and paste into your project.
## Configuration
Configuration can be split across three files to make it easier to understand and manage.
You can copy over the following configuration files into the root of your project to get started:
* [next-auth.config.js](https://github.com/iaincollins/next-auth/tree/master/example/next-auth.config.js)
* [next-auth.functions.js](https://github.com/iaincollins/next-auth/tree/master/example/next-auth.functions.js)
* [next-auth.providers.js](https://github.com/iaincollins/next-auth/tree/master/example/next-auth.providers.js)
You can also add a **.env** file to the root of the project as a place to specify configuration options. The provided example files for NextAuth will use one if there is is one.
````
SERVER_URL=http://localhost:3000
MONGO_URI=mongodb://localhost:27017/my-database
FACEBOOK_ID=
FACEBOOK_SECRET=
GOOGLE_ID=
GOOGLE_SECRET=
TWITTER_KEY=
TWITTER_SECRET=
EMAIL_FROM=username@gmail.com
EMAIL_SERVER=smtp.gmail.com
EMAIL_PORT=465
EMAIL_USERNAME=username@gmail.com
EMAIL_PASSWORD=
````
### next-auth.config.js
Basic configuration of NextAuth is handled in **next-auth.config.js**.
It is also where the **next-auth.functions.js** and **next-auth.providers.js** files are loaded.
### next-auth.functions.js
Methods for user management and sending email are defined in **next-auth.functions.js**
The example configuration provided is for Mongo DB. By defining the behaviour in these functions you can use NextAuth with any database, including a relational database that uses SQL.
#### Required
* find({id,email,emailToken,provider})
* insert(user, oAuthProfile, providerParams)
* update(user, oAuthProfile, providerParams)
* remove(id)
* serialize(user)
* deserialize(id)
#### Optional
* sendSigninEmail({email, url, req})
* signIn({form, req})
The `sendSigninEmail()` method is used to send an email for email token based sign in (one time use passwords). Omit it or set it to null to disable email based sign in.
The `signIn()` method is used to handle authenticating with custom credentials (e.g. username and password, 2FA token, etc). Omit it or leave it undefined unless you need it.
You can use any combination of authentication methods (email, credentials, oAuth providers).
### next-auth.providers.js
Configuration for oAuth providers are defined in **next-auth.providers.js**
It includes configuration examples for Facebook, Google and Twitter oAuth, which can easily be copied and replicated to add support for signing in other oAuth providers.
For tips on configuring oAuth see [AUTHENTICATION.md](https://github.com/iaincollins/next-auth/tree/master/AUTHENTICATION.md).
----
See the included [example site](https://github.com/iaincollins/next-auth/tree/master/example) and the expanded example at [nextjs-starter.now.sh](https://nextjs-starter.now.sh/examples/authentication).
ISC

View File

@@ -0,0 +1,61 @@
# Rename file to .env.local (or .env) and populate values
# to be able to run the dev app
NEXTAUTH_URL=http://localhost:3000
# You can use `openssl rand -hex 32` or
# https://generate-secret.vercel.app/32 to generate a secret.
# Note: Changing a secret may invalidate existing sessions
# and/or verification tokens.
NEXTAUTH_SECRET=secret
AUTH0_ID=
AUTH0_SECRET=
AUTH0_ISSUER=
DESCOPE_ID=
DESCOPE_SECRET=
KEYCLOAK_ID=
KEYCLOAK_SECRET=
KEYCLOAK_ISSUER=
IDS4_ID=
IDS4_SECRET=
IDS4_ISSUER=
GITHUB_ID=
GITHUB_SECRET=
TWITCH_ID=
TWITCH_SECRET=
TWITTER_ID=
TWITTER_SECRET=
LINE_ID=
LINE_SECRET=
TRAKT_ID=
TRAKT_SECRET=
# Example configuration for a Gmail account (will need SMTP enabled)
EMAIL_SERVER=smtps://user@gmail.com:password@smtp.gmail.com:465
EMAIL_FROM=user@gmail.com
# Note: If using with Prisma adapter, you need to use a `.env`
# file rather than a `.env.local` file to configure env vars.
# Postgres: DATABASE_URL=postgres://nextauth:password@127.0.0.1:5432/nextauth?synchronize=true
# MySQL: DATABASE_URL=mysql://nextauth:password@127.0.0.1:3306/nextauth?synchronize=true
# 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

View File

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

View File

@@ -0,0 +1,6 @@
# NextAuth.js Development App
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:
[Setting up local environment
](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md#setting-up-local-environment)

View File

@@ -0,0 +1,14 @@
import NextAuth, { type NextAuthOptions } from "next-auth"
import GitHub from "next-auth/providers/github"
export const authOptions: NextAuthOptions = {
providers: [
GitHub({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
}
const handler = NextAuth(authOptions)
export { handler as GET, handler as POST }

View File

@@ -0,0 +1,12 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html>
<head></head>
<body>{children}</body>
</html>
)
}

View File

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

View File

@@ -0,0 +1,20 @@
import { signIn } from "next-auth/react"
export default function AccessDenied() {
return (
<>
<h1>Access Denied</h1>
<p>
<a
href="/api/auth/signin"
onClick={(e) => {
e.preventDefault()
signIn()
}}
>
You must be signed in to view this page
</a>
</p>
</>
)
}

View File

@@ -0,0 +1,28 @@
import Link from "next/link"
import styles from "./footer.module.css"
import packageJSON from "package.json"
export default function Footer() {
return (
<footer className={styles.footer}>
<hr />
<ul className={styles.navItems}>
<li className={styles.navItem}>
<a href="https://next-auth.js.org">Documentation</a>
</li>
<li className={styles.navItem}>
<a href="https://www.npmjs.com/package/next-auth">NPM</a>
</li>
<li className={styles.navItem}>
<a href="https://github.com/nextauthjs/next-auth-example">GitHub</a>
</li>
<li className={styles.navItem}>
<Link href="/policy">Policy</Link>
</li>
<li className={styles.navItem}>
<em>{packageJSON.version}</em>
</li>
</ul>
</footer>
)
}

View File

@@ -0,0 +1,14 @@
.footer {
margin-top: 2rem;
}
.navItems {
margin-bottom: 1rem;
padding: 0;
list-style: none;
}
.navItem {
display: inline-block;
margin-right: 1rem;
}

View File

@@ -0,0 +1,103 @@
import Link from "next/link"
import { signIn, signOut, 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
// component that works on pages which support both client and server side
// rendering, and avoids any flash incorrect content on initial page load.
export default function Header() {
const { data: session, status } = useSession()
return (
<header>
<noscript>
<style>{".nojs-show { opacity: 1; top: 0; }"}</style>
</noscript>
<div className={styles.signedInStatus}>
<p
className={`nojs-show ${
!session && status === "loading" ? styles.loading : styles.loaded
}`}
>
{!session && (
<>
<span className={styles.notSignedInText}>
You are not signed in
</span>
<a
href="/api/auth/signin"
className={styles.buttonPrimary}
onClick={(e) => {
e.preventDefault()
signIn()
}}
>
Sign in
</a>
</>
)}
{session && (
<>
{session.user.image && (
<img src={session.user.image} className={styles.avatar} />
)}
<span className={styles.signedInText}>
<small>Signed in as</small>
<br />
<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()
}}
>
Sign out
</a>
</>
)}
</p>
</div>
<nav>
<ul className={styles.navItems}>
<li className={styles.navItem}>
<Link href="/">Home</Link>
</li>
<li className={styles.navItem}>
<Link href="/client">Client</Link>
</li>
<li className={styles.navItem}>
<Link href="/server">Server</Link>
</li>
<li className={styles.navItem}>
<Link href="/protected">Protected</Link>
</li>
<li className={styles.navItem}>
<Link href="/protected-ssr">Protected(SSR)</Link>
</li>
<li className={styles.navItem}>
<Link href="/api-example">API</Link>
</li>
<li className={styles.navItem}>
<Link href="/credentials">Credentials</Link>
</li>
<li className={styles.navItem}>
<Link href="/email">Email</Link>
</li>
<li className={styles.navItem}>
<Link href="/middleware-protected">Middleware protected</Link>
</li>
<li className={styles.navItem}>
<Link href="/supabase-client-rls">Supabase RLS</Link>
</li>
<li className={styles.navItem}>
<Link href="/supabase-ssr">Supabase RLS(SSR)</Link>
</li>
</ul>
</nav>
</header>
)
}

View File

@@ -0,0 +1,92 @@
/* Set min-height to avoid page reflow while session loading */
.signedInStatus {
display: block;
min-height: 4rem;
width: 100%;
}
.loading,
.loaded {
position: relative;
top: 0;
opacity: 1;
overflow: hidden;
border-radius: 0 0 .6rem .6rem;
padding: .6rem 1rem;
margin: 0;
background-color: rgba(0,0,0,.05);
transition: all 0.2s ease-in;
}
.loading {
top: -2rem;
opacity: 0;
}
.signedInText,
.notSignedInText {
position: absolute;
padding-top: .8rem;
left: 1rem;
right: 6.5rem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inherit;
z-index: 1;
line-height: 1.3rem;
}
.signedInText {
padding-top: 0rem;
left: 4.6rem;
}
.avatar {
border-radius: 2rem;
float: left;
height: 2.8rem;
width: 2.8rem;
background-color: white;
background-size: cover;
background-repeat: no-repeat;
}
.button,
.buttonPrimary {
float: right;
margin-right: -.4rem;
font-weight: 500;
border-radius: .3rem;
cursor: pointer;
font-size: 1rem;
line-height: 1.4rem;
padding: .7rem .8rem;
position: relative;
z-index: 10;
background-color: transparent;
color: #555;
}
.buttonPrimary {
background-color: #346df1;
border-color: #346df1;
color: #fff;
text-decoration: none;
padding: .7rem 1.4rem;
}
.buttonPrimary:hover {
box-shadow: inset 0 0 5rem rgba(0,0,0,0.2)
}
.navItems {
margin-bottom: 2rem;
padding: 0;
list-style: none;
}
.navItem {
display: inline-block;
margin-right: 1rem;
}

View File

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

View File

@@ -0,0 +1,45 @@
export { default } from "next-auth/middleware"
export const config = { matcher: ["/middleware-protected"] }
// Other ways to use this middleware
// import withAuth from "next-auth/middleware"
// import { withAuth } from "next-auth/middleware"
// export function middleware(req, ev) {
// return withAuth(req)
// }
// export function middleware(req, ev) {
// return withAuth(req, ev)
// }
// export function middleware(req, ev) {
// return withAuth(req, {
// callbacks: {
// authorized: ({ token }) => !!token,
// },
// })
// }
// export default withAuth(function middleware(req, ev) {
// console.log(req.nextauth.token)
// })
// export default withAuth(
// function middleware(req, ev) {
// console.log(req, ev)
// },
// {
// callbacks: {
// authorized: ({ token }) => token.name === "Balázs Orbán",
// },
// }
// )
// export default withAuth({
// callbacks: {
// authorized: ({ token }) => !!token,
// },
// })

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

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

View File

@@ -0,0 +1,9 @@
/** @type {import("next").NextConfig} */
module.exports = {
webpack(config) {
config.experiments = { ...config.experiments, topLevelAwait: true }
return config
},
experimental: { appDir: true },
typescript: { ignoreBuildErrors: true },
}

View File

@@ -0,0 +1,40 @@
{
"name": "next-auth-app-v4",
"version": "1.0.0",
"description": "NextAuth.js Developer app",
"private": true,
"scripts": {
"clean": "rm -rf .next",
"dev": "next dev",
"lint": "next lint",
"build": "next build",
"start": "next start",
"email": "fake-smtp-server",
"start:email": "pnpm email"
},
"license": "ISC",
"dependencies": {
"@auth/fauna-adapter": "workspace:*",
"@auth/prisma-adapter": "workspace:*",
"@auth/supabase-adapter": "workspace:*",
"@auth/typeorm-adapter": "workspace:*",
"@prisma/client": "^3",
"@supabase/supabase-js": "^2.0.5",
"faunadb": "^4",
"next": "13.3.0",
"next-auth": "workspace:*",
"nodemailer": "^6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@types/jsonwebtoken": "^8.5.5",
"@types/react": "^18.0.37",
"@types/react-dom": "^18.0.6",
"fake-smtp-server": "^0.8.0",
"pg": "^8.7.3",
"prisma": "^3",
"sqlite3": "^5.0.8",
"typeorm": "0.3.7"
}
}

View File

@@ -0,0 +1,10 @@
import { SessionProvider } from "next-auth/react"
import "./styles.css"
export default function App({ Component, pageProps }) {
return (
<SessionProvider session={pageProps.session}>
<Component {...pageProps} />
</SessionProvider>
)
}

View File

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

View File

@@ -0,0 +1,217 @@
import NextAuth, { NextAuthOptions } from "next-auth"
// Providers
import Apple from "next-auth/providers/apple"
import Auth0 from "next-auth/providers/auth0"
import AzureAD from "next-auth/providers/azure-ad"
import AzureB2C from "next-auth/providers/azure-ad-b2c"
import BoxyHQSAML from "next-auth/providers/boxyhq-saml"
// import Cognito from "next-auth/providers/cognito"
import Credentials from "next-auth/providers/credentials"
import Discord from "next-auth/providers/discord"
import DuendeIDS6 from "next-auth/providers/duende-identity-server6"
// import Email from "next-auth/providers/email"
import Facebook from "next-auth/providers/facebook"
import Foursquare from "next-auth/providers/foursquare"
import Freshbooks from "next-auth/providers/freshbooks"
import GitHub from "next-auth/providers/github"
import Gitlab from "next-auth/providers/gitlab"
import Google from "next-auth/providers/google"
// import IDS4 from "next-auth/providers/identity-server4"
import Instagram from "next-auth/providers/instagram"
// import Keycloak from "next-auth/providers/keycloak"
import Line from "next-auth/providers/line"
import LinkedIn from "next-auth/providers/linkedin"
import Mailchimp from "next-auth/providers/mailchimp"
// import Okta from "next-auth/providers/okta"
import Osu from "next-auth/providers/osu"
import Patreon from "next-auth/providers/patreon"
import Slack from "next-auth/providers/slack"
import Spotify from "next-auth/providers/spotify"
import Trakt from "next-auth/providers/trakt"
import Twitch from "next-auth/providers/twitch"
import Twitter from "next-auth/providers/twitter"
import Vk from "next-auth/providers/vk"
import Wikimedia from "next-auth/providers/wikimedia"
import WorkOS from "next-auth/providers/workos"
// // Prisma
// import { PrismaClient } from "@prisma/client"
// import { PrismaAdapter } from "@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 "@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 { TypeORMAdapter } from "@auth/typeorm-adapter"
// const adapter = TypeORMAdapter({
// type: "sqlite",
// name: "next-auth-test-memory",
// database: "./typeorm/dev.db",
// synchronize: true,
// })
// // Supabase
// import { SupabaseAdapter } from "@auth/supabase-adapter"
// const adapter = SupabaseAdapter({
// url: process.env.NEXT_PUBLIC_SUPABASE_URL,
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
// })
export const authOptions: NextAuthOptions = {
// adapter,
// debug: process.env.NODE_ENV !== "production",
theme: {
logo: "https://next-auth.js.org/img/logo/logo-sm.png",
brandColor: "#1786fb",
},
providers: [
Credentials({
credentials: { password: { label: "Password", type: "password" } },
async authorize(credentials) {
if (credentials.password !== "pw") return null
return {
name: "Fill Murray",
email: "bill@fillmurray.com",
image: "https://www.fillmurray.com/64/64",
id: "1",
foo: "",
}
},
}),
Apple({
clientId: process.env.APPLE_ID,
clientSecret: process.env.APPLE_SECRET,
}),
Auth0({
clientId: process.env.AUTH0_ID,
clientSecret: process.env.AUTH0_SECRET,
issuer: process.env.AUTH0_ISSUER,
}),
AzureAD({
clientId: process.env.AZURE_AD_CLIENT_ID,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET,
tenantId: process.env.AZURE_AD_TENANT_ID,
}),
AzureB2C({
clientId: process.env.AZURE_B2C_ID,
clientSecret: process.env.AZURE_B2C_SECRET,
issuer: process.env.AZURE_B2C_ISSUER,
}),
BoxyHQSAML({
issuer: "https://jackson-demo.boxyhq.com",
clientId: "tenant=boxyhq.com&product=saml-demo.boxyhq.com",
clientSecret: "dummy",
}),
// Cognito({ clientId: process.env.COGNITO_ID, clientSecret: process.env.COGNITO_SECRET, issuer: process.env.COGNITO_ISSUER }),
Discord({
clientId: process.env.DISCORD_ID,
clientSecret: process.env.DISCORD_SECRET,
}),
DuendeIDS6({
clientId: "interactive.confidential",
clientSecret: "secret",
issuer: "https://demo.duendesoftware.com",
}),
Facebook({
clientId: process.env.FACEBOOK_ID,
clientSecret: process.env.FACEBOOK_SECRET,
}),
Foursquare({
clientId: process.env.FOURSQUARE_ID,
clientSecret: process.env.FOURSQUARE_SECRET,
}),
Freshbooks({
clientId: process.env.FRESHBOOKS_ID,
clientSecret: process.env.FRESHBOOKS_SECRET,
}),
GitHub({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
Gitlab({
clientId: process.env.GITLAB_ID,
clientSecret: process.env.GITLAB_SECRET,
}),
Google({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
// IDS4({ clientId: process.env.IDS4_ID, clientSecret: process.env.IDS4_SECRET, issuer: process.env.IDS4_ISSUER }),
Instagram({
clientId: process.env.INSTAGRAM_ID,
clientSecret: process.env.INSTAGRAM_SECRET,
}),
// Keycloak({ clientId: process.env.KEYCLOAK_ID, clientSecret: process.env.KEYCLOAK_SECRET, issuer: process.env.KEYCLOAK_ISSUER }),
Line({
clientId: process.env.LINE_ID,
clientSecret: process.env.LINE_SECRET,
}),
LinkedIn({
clientId: process.env.LINKEDIN_ID,
clientSecret: process.env.LINKEDIN_SECRET,
}),
Mailchimp({
clientId: process.env.MAILCHIMP_ID,
clientSecret: process.env.MAILCHIMP_SECRET,
}),
// Okta({ clientId: process.env.OKTA_ID, clientSecret: process.env.OKTA_SECRET, issuer: process.env.OKTA_ISSUER }),
Osu({
clientId: process.env.OSU_CLIENT_ID,
clientSecret: process.env.OSU_CLIENT_SECRET,
}),
Patreon({
clientId: process.env.PATREON_ID,
clientSecret: process.env.PATREON_SECRET,
}),
Slack({
clientId: process.env.SLACK_ID,
clientSecret: process.env.SLACK_SECRET,
}),
Spotify({
clientId: process.env.SPOTIFY_ID,
clientSecret: process.env.SPOTIFY_SECRET,
}),
Trakt({
clientId: process.env.TRAKT_ID,
clientSecret: process.env.TRAKT_SECRET,
}),
Twitch({
clientId: process.env.TWITCH_ID,
clientSecret: process.env.TWITCH_SECRET,
}),
Twitter({
clientId: process.env.TWITTER_ID,
clientSecret: process.env.TWITTER_SECRET,
}),
// TwitterLegacy({ clientId: process.env.TWITTER_LEGACY_ID, clientSecret: process.env.TWITTER_LEGACY_SECRET }),
Vk({ clientId: process.env.VK_ID, clientSecret: process.env.VK_SECRET }),
Wikimedia({
clientId: process.env.WIKIMEDIA_ID,
clientSecret: process.env.WIKIMEDIA_SECRET,
}),
WorkOS({
clientId: process.env.WORKOS_ID,
clientSecret: process.env.WORKOS_SECRET,
}),
],
}
if (authOptions.adapter) {
// TODO:
// authOptions.providers.unshift(
// // NOTE: You can start a fake e-mail server with `pnpm email`
// // and then go to `http://localhost:1080` in the browser
// Email({ server: "smtp://127.0.0.1:1025?tls.rejectUnauthorized=false" })
// )
}
export default NextAuth(authOptions)

View File

@@ -0,0 +1,7 @@
// This is an example of how to read a JSON Web Token from an API route
import { getToken } from "next-auth/jwt"
export default async (req, res) => {
const token = await getToken({ req })
res.send(JSON.stringify(token, null, 2))
}

View File

@@ -0,0 +1,19 @@
// This is an example of to protect an API route
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
export default async (req, res) => {
const session = await getServerSession(req, res, authOptions)
if (session) {
res.send({
content:
"This is protected content. You can access this content because you are signed in.",
session,
})
} else {
res.send({
error: "You must be sign in to view the protected content on this page.",
})
}
}

View File

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

View File

@@ -0,0 +1,30 @@
// This is an example of how to query data from Supabase with RLS.
// Learn more about Row Levele Security (RLS): https://supabase.com/docs/guides/auth/row-level-security
import { getServerSession } from "next-auth/next"
import { authOptions } from "../auth/[...nextauth]"
import { createClient } from "@supabase/supabase-js"
export default async (req, res) => {
const session = await getServerSession(req, res, authOptions)
if (!session)
return res.send(JSON.stringify({ error: "No session!" }, null, 2))
const { supabaseAccessToken } = session
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
{
global: {
headers: {
Authorization: `Bearer ${supabaseAccessToken}`,
},
},
}
)
// Now you can query with RLS enabled.
const { data, error } = await supabase.from("users").select("*")
res.send(JSON.stringify({ supabaseAccessToken, data, error }, null, 2))
}

View File

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

View File

@@ -0,0 +1,67 @@
// eslint-disable-next-line no-use-before-define
import * as React from "react"
import { signIn, signOut, useSession } from "next-auth/react"
import Layout from "components/layout"
export default function Page() {
const [response, setResponse] = React.useState(null)
const handleLogin = (options) => async () => {
if (options.redirect) {
return signIn("credentials", options)
}
const response = await signIn("credentials", options)
setResponse(response)
}
const handleLogout = (options) => async () => {
if (options.redirect) {
return signOut(options)
}
const response = await signOut(options)
setResponse(response)
}
const { data: session } = useSession()
if (session) {
return (
<Layout>
<h1>Test different flows for Credentials logout</h1>
<span className="spacing">Default:</span>
<button onClick={handleLogout({ redirect: true })}>Logout</button>
<br />
<span className="spacing">No redirect:</span>
<button onClick={handleLogout({ redirect: false })}>Logout</button>
<br />
<p>Response:</p>
<pre style={{ background: "#eee", padding: 16 }}>
{JSON.stringify(response, null, 2)}
</pre>
</Layout>
)
}
return (
<Layout>
<h1>Test different flows for Credentials login</h1>
<span className="spacing">Default:</span>
<button onClick={handleLogin({ redirect: true, password: "password" })}>
Login
</button>
<br />
<span className="spacing">No redirect:</span>
<button onClick={handleLogin({ redirect: false, password: "password" })}>
Login
</button>
<br />
<span className="spacing">No redirect, wrong password:</span>
<button onClick={handleLogin({ redirect: false, password: "" })}>
Login
</button>
<p>Response:</p>
<pre style={{ background: "#eee", padding: 16 }}>
{JSON.stringify(response, null, 2)}
</pre>
</Layout>
)
}

View File

@@ -0,0 +1,80 @@
// eslint-disable-next-line no-use-before-define
import * as React from "react"
import { signIn, signOut, useSession } from "next-auth/react"
import Layout from "components/layout"
export default function Page() {
const [response, setResponse] = React.useState(null)
const [email, setEmail] = React.useState("")
const handleChange = (event) => {
setEmail(event.target.value)
}
const handleLogin = (options) => async (event) => {
event.preventDefault()
if (options.redirect) {
return signIn("email", options)
}
const response = await signIn("email", options)
setResponse(response)
}
const handleLogout = (options) => async (event) => {
if (options.redirect) {
return signOut(options)
}
const response = await signOut(options)
setResponse(response)
}
const { data: session } = useSession()
if (session) {
return (
<Layout>
<h1>Test different flows for Email logout</h1>
<span className="spacing">Default:</span>
<button onClick={handleLogout({ redirect: true })}>Logout</button>
<br />
<span className="spacing">No redirect:</span>
<button onClick={handleLogout({ redirect: false })}>Logout</button>
<br />
<p>Response:</p>
<pre style={{ background: "#eee", padding: 16 }}>
{JSON.stringify(response, null, 2)}
</pre>
</Layout>
)
}
return (
<Layout>
<h1>Test different flows for Email login</h1>
<label className="spacing">
Email address:{" "}
<input
type="text"
id="email"
name="email"
value={email}
onChange={handleChange}
/>
</label>
<br />
<form onSubmit={handleLogin({ redirect: true, email })}>
<span className="spacing">Default:</span>
<button type="submit">Sign in with Email</button>
</form>
<form onSubmit={handleLogin({ redirect: false, email })}>
<span className="spacing">No redirect:</span>
<button type="submit">Sign in with Email</button>
</form>
<p>Response:</p>
<pre style={{ background: "#eee", padding: 16 }}>
{JSON.stringify(response, null, 2)}
</pre>
</Layout>
)
}

View File

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

View File

@@ -0,0 +1,9 @@
import Layout from "components/layout"
export default function Page() {
return (
<Layout>
<h1>Page protected by Middleware</h1>
</Layout>
)
}

View File

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

View File

@@ -0,0 +1,48 @@
// This is an example of how to protect content using server rendering
import { getServerSession } from "next-auth/next"
import { authOptions } from "./api/auth/[...nextauth]"
import Layout from "../components/layout"
import AccessDenied from "../components/access-denied"
export default function Page({ content, session }) {
// If no session exists, display access denied message
if (!session) {
return (
<Layout>
<AccessDenied />
</Layout>
)
}
// If session exists, display content
return (
<Layout>
<h1>Protected Page</h1>
<p>
<strong>{content}</strong>
</p>
</Layout>
)
}
export async function getServerSideProps(context) {
const session = await getServerSession(context.req, context.res, authOptions)
let content = null
if (session) {
const hostname = process.env.NEXTAUTH_URL || "http://localhost:3000"
const options = { headers: { cookie: context.req.headers.cookie } }
const res = await fetch(`${hostname}/api/examples/protected`, options)
const json = await res.json()
if (json.content) {
content = json.content
}
}
return {
props: {
session,
content,
},
}
}

View File

@@ -0,0 +1,35 @@
import { useState, useEffect } from "react"
import { useSession } from "next-auth/react"
import Layout from "../components/layout"
export default function Page() {
const { status } = useSession({
required: true,
})
const [content, setContent] = useState()
// Fetch content from protected route
useEffect(() => {
if (status === "loading") return
const fetchData = async () => {
const res = await fetch("/api/examples/protected")
const json = await res.json()
if (json.content) {
setContent(json.content)
}
}
fetchData()
}, [status])
if (status === "loading") return <Layout>Loading...</Layout>
// If session exists, display content
return (
<Layout>
<h1>Protected Page</h1>
<p>
<strong>{content}</strong>
</p>
</Layout>
)
}

View File

@@ -0,0 +1,46 @@
import { getServerSession } from "next-auth/next"
import Layout from "../components/layout"
import { authOptions } from "./api/auth/[...nextauth]"
export default function Page() {
// As this page uses Server Side Rendering, the `session` will be already
// populated on render without needing to go through a loading stage.
// This is possible because of the shared context configured in `_app.js` that
// is used by `useSession()`.
return (
<Layout>
<h1>Server Side Rendering</h1>
<p>
This page uses the <strong>getServerSession()</strong> method in{" "}
<strong>getServerSideProps()</strong>.
</p>
<p>
Using <strong>getServerSession()</strong> in{" "}
<strong>getServerSideProps()</strong> is currently the recommended
approach, although the API may still change, if you need to support
Server Side Rendering with authentication.
</p>
<p>
Using <strong>getSession()</strong> is still recommended on the client.
</p>
<p>
The advantage of Server Side Rendering is this page does not require
client side JavaScript.
</p>
<p>
The disadvantage of Server Side Rendering is that this page is slower to
render.
</p>
</Layout>
)
}
// Export the `session` prop to use sessions with Server Side Rendering
export async function getServerSideProps(context) {
return {
props: {
session: await getServerSession(context.req, context.res, authOptions),
},
}
}

View File

@@ -0,0 +1,32 @@
body {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
padding: 0 1rem 1rem 1rem;
max-width: 680px;
margin: 0 auto;
background: #fff;
color: var(--color-text);
}
li,
p {
line-height: 1.5rem;
}
a {
font-weight: 500;
}
hr {
border: 1px solid #ddd;
}
iframe {
background: #ccc;
border: 1px solid #ccc;
height: 10rem;
width: 100%;
border-radius: .5rem;
filter: invert(1);
}

View File

@@ -0,0 +1,49 @@
import Layout from "../components/layout"
import { useState, useEffect } from "react"
import { useSession } from "next-auth/react"
import { createClient } from "@supabase/supabase-js"
export default function Page() {
const { data: session } = useSession()
const [data, setData] = useState(null)
useEffect(() => {
if (session) {
console.log(session)
// User is logged in, let's fetch their data.
const { supabaseAccessToken } = session
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
{
global: {
headers: { Authorization: `Bearer ${supabaseAccessToken}` },
},
}
)
// Fetch data with RLS enabled.
supabase
.from("users")
.select("*")
.then(({ data }) => setData(data))
}
}, [session])
return (
<Layout>
<h1>Fetch Data from Supabase with RLS</h1>
<h2>Client-side data fetching with RLS:</h2>
<pre>{JSON.stringify(data, null, 2)}</pre>
<h2>API Example</h2>
<p>
You can also use Supabase in API routes. See the code in the
`/pages/api/examples/supabase-rls.js` file.
</p>
<p>
<em>You must be signed in to see responses.</em>
</p>
<p>/api/examples/supabase-rls</p>
<iframe src="/api/examples/supabase-rls" />
</Layout>
)
}

View File

@@ -0,0 +1,64 @@
// This is an example of how to protect content using server rendering
// and fetching data from Supabase with RLS enabled.
import { getServerSession } from "next-auth/next"
import { authOptions } from "./api/auth/[...nextauth]"
import { createClient } from "@supabase/supabase-js"
import Layout from "../components/layout"
import AccessDenied from "../components/access-denied"
export default function Page({ data, session }) {
// If no session exists, display access denied message
if (!session) {
return (
<Layout>
<AccessDenied />
</Layout>
)
}
// If session exists, display content
return (
<Layout>
<h1>Protected Page</h1>
<p>Data fetched during SSR from Supabase with RSL enabled:</p>
<pre>{JSON.stringify(data, null, 2)}</pre>
</Layout>
)
}
export async function getServerSideProps(context) {
const session = await getServerSession(context.req, context.res, authOptions)
if (!session)
return {
props: {
session,
data: null,
error: "No session",
},
}
const { supabaseAccessToken } = session
const supabase = createClient(
process.env.NEXT_PUBLIC_SUPABASE_URL,
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY,
{
global: {
headers: {
Authorization: `Bearer ${supabaseAccessToken}`,
},
},
}
)
// Now you can query with RLS enabled.
const { data, error } = await supabase.from("users").select("*")
return {
props: {
session,
data,
error,
},
}
}

View File

@@ -0,0 +1,60 @@
-- CreateTable
CREATE TABLE "Account" (
"id" TEXT NOT NULL PRIMARY KEY,
"userId" TEXT NOT NULL,
"type" TEXT NOT NULL,
"provider" TEXT NOT NULL,
"providerAccountId" TEXT NOT NULL,
"refresh_token" TEXT,
"access_token" TEXT,
"expires_at" INTEGER,
"token_type" TEXT,
"scope" TEXT,
"id_token" TEXT,
"session_state" TEXT,
"oauth_token_secret" TEXT,
"oauth_token" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "Session" (
"id" TEXT NOT NULL PRIMARY KEY,
"sessionToken" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"expires" DATETIME NOT NULL,
CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT,
"email" TEXT,
"emailVerified" DATETIME,
"image" TEXT
);
-- CreateTable
CREATE TABLE "VerificationToken" (
"identifier" TEXT NOT NULL,
"token" TEXT NOT NULL,
"expires" DATETIME NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "Account_provider_providerAccountId_key" ON "Account"("provider", "providerAccountId");
-- CreateIndex
CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken");
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
-- CreateIndex
CREATE UNIQUE INDEX "VerificationToken_token_key" ON "VerificationToken"("token");
-- CreateIndex
CREATE UNIQUE INDEX "VerificationToken_identifier_token_key" ON "VerificationToken"("identifier", "token");

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"

View File

@@ -0,0 +1,57 @@
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
generator client {
provider = "prisma-client-js"
}
model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String?
access_token String?
expires_at Int?
token_type String?
scope String?
id_token String?
session_state String?
oauth_token_secret String?
oauth_token String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
@@unique([provider, providerAccountId])
}
model Session {
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id])
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
}
model VerificationToken {
identifier String
token String @unique
expires DateTime
@@unique([identifier, token])
}

View File

@@ -0,0 +1,39 @@
{
"compilerOptions": {
"target": "esnext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,
"jsx": "preserve",
"baseUrl": ".",
"plugins": [
{
"name": "next"
}
],
"strictNullChecks": true
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules",
"jest.config.js"
]
}

20
apps/dev/nextjs-v4/types/nextauth.d.ts vendored Normal file
View File

@@ -0,0 +1,20 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import NextAuth from "next-auth"
declare module "next-auth" {
/**
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
*/
interface Session {
// A JWT which can be used as Authorization header with supabase-js for RLS.
supabaseAccessToken?: string
user: {
/** The user's postal address. */
address: string
} & User
}
interface User {
foo: string
}
}

View File

@@ -0,0 +1,78 @@
# Rename file to .env.local (or .env) and populate values
# to be able to run the dev app
NEXTAUTH_URL=http://localhost:3000
# You can use `openssl rand -hex 32` or
# https://generate-secret.vercel.app/32 to generate a secret.
# Note: Changing a secret may invalidate existing sessions
# and/or verification tokens.
NEXTAUTH_SECRET=secret
ASGARDEO_CLIENT_ID=
ASGARDEO_CLIENT_SECRET=
ASGARDEO_ISSUER=
AUTH0_ID=
AUTH0_SECRET=
AUTH0_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=
KEYCLOAK_ID=
KEYCLOAK_SECRET=
KEYCLOAK_ISSUER=
LINE_ID=
LINE_SECRET=
TRAKT_ID=
TRAKT_SECRET=
TWITCH_ID=
TWITCH_SECRET=
TWITTER_ID=
TWITTER_SECRET=
WIKIMEDIA_ID=
WIKIMEDIA_SECRET=
# Yandex OAuth. new app -> https://oauth.yandex.com/client/new/id
YANDEX_ID=
YANDEX_SECRET=
# Example configuration for a Gmail account (will need SMTP enabled)
EMAIL_SERVER=smtps://user@gmail.com:password@smtp.gmail.com:465
EMAIL_FROM=user@gmail.com
# Note: If using with Prisma adapter, you need to use a `.env`
# file rather than a `.env.local` file to configure env vars.
# Postgres: DATABASE_URL=postgres://nextauth:password@127.0.0.1:5432/nextauth?synchronize=true
# MySQL: DATABASE_URL=mysql://nextauth:password@127.0.0.1:3306/nextauth?synchronize=true
# MongoDB: DATABASE_URL=mongodb://nextauth:password@127.0.0.1:27017/nextauth?synchronize=true
DATABASE_URL=
# 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

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

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

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

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

View File

@@ -0,0 +1,6 @@
# NextAuth.js Development App
This folder contains a Next.js app using NextAuth.js for local development. See the following section on how to start:
[Setting up local environment
](https://github.com/nextauthjs/.github/blob/main/CONTRIBUTING.md#setting-up-local-environment)

View File

@@ -0,0 +1,12 @@
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html>
<head></head>
<body>{children}</body>
</html>
)
}

View File

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

View File

@@ -0,0 +1,20 @@
import { signIn } from "next-auth/react"
export default function AccessDenied() {
return (
<>
<h1>Access Denied</h1>
<p>
<a
href="/api/auth/signin"
onClick={(e) => {
e.preventDefault()
signIn()
}}
>
You must be signed in to view this page
</a>
</p>
</>
)
}

View File

@@ -0,0 +1,28 @@
import Link from "next/link"
import styles from "./footer.module.css"
import packageJSON from "package.json"
export default function Footer() {
return (
<footer className={styles.footer}>
<hr />
<ul className={styles.navItems}>
<li className={styles.navItem}>
<a href="https://authjs.dev">Documentation</a>
</li>
<li className={styles.navItem}>
<a href="https://www.npmjs.com/package/@auth/core">NPM</a>
</li>
<li className={styles.navItem}>
<a href="https://github.com/nextauthjs/next-auth-example">GitHub</a>
</li>
<li className={styles.navItem}>
<Link href="/policy">Policy</Link>
</li>
<li className={styles.navItem}>
<em>{packageJSON.version}</em>
</li>
</ul>
</footer>
)
}

View File

@@ -0,0 +1,14 @@
.footer {
margin-top: 2rem;
}
.navItems {
margin-bottom: 1rem;
padding: 0;
list-style: none;
}
.navItem {
display: inline-block;
margin-right: 1rem;
}

View File

@@ -0,0 +1,89 @@
import Link from "next/link"
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
// component that works on pages which support both client and server side
// rendering, and avoids any flash incorrect content on initial page load.
export default function Header() {
const { data: session, status } = useSession()
return (
<header>
<noscript>
<style>{".nojs-show { opacity: 1; top: 0; }"}</style>
</noscript>
<div className={styles.signedInStatus}>
<p
className={`nojs-show ${
!session && status === "loading" ? styles.loading : styles.loaded
}`}
>
{!session && (
<>
<span className={styles.notSignedInText}>
You are not signed in
</span>
<a href="/api/auth/signin" className={styles.buttonPrimary}>
Sign in
</a>
</>
)}
{session && (
<>
{session.user.image && (
<img src={session.user.image} className={styles.avatar} />
)}
<span className={styles.signedInText}>
<small>Signed in as</small>
<br />
<strong>{session.user.email} </strong>
{session.user.name ? `(${session.user.name})` : null}
</span>
<a href="/api/auth/signout" className={styles.button}>
Sign out
</a>
</>
)}
</p>
</div>
<nav>
<ul className={styles.navItems}>
<li className={styles.navItem}>
<Link href="/">Home</Link>
</li>
<li className={styles.navItem}>
<Link href="/client">Client</Link>
</li>
<li className={styles.navItem}>
<Link href="/server">Server</Link>
</li>
<li className={styles.navItem}>
<Link href="/protected">Protected</Link>
</li>
<li className={styles.navItem}>
<Link href="/protected-ssr">Protected(SSR)</Link>
</li>
<li className={styles.navItem}>
<Link href="/api-example">API</Link>
</li>
<li className={styles.navItem}>
<Link href="/credentials">Credentials</Link>
</li>
<li className={styles.navItem}>
<Link href="/email">Email</Link>
</li>
<li className={styles.navItem}>
<Link href="/middleware-protected">Middleware protected</Link>
</li>
<li className={styles.navItem}>
<Link href="/supabase-client-rls">Supabase RLS</Link>
</li>
<li className={styles.navItem}>
<Link href="/supabase-ssr">Supabase RLS(SSR)</Link>
</li>
</ul>
</nav>
</header>
)
}

View File

@@ -0,0 +1,92 @@
/* Set min-height to avoid page reflow while session loading */
.signedInStatus {
display: block;
min-height: 4rem;
width: 100%;
}
.loading,
.loaded {
position: relative;
top: 0;
opacity: 1;
overflow: hidden;
border-radius: 0 0 0.6rem 0.6rem;
padding: 0.6rem 1rem;
margin: 0;
background-color: rgba(0, 0, 0, 0.05);
transition: all 0.2s ease-in;
}
.loading {
top: -2rem;
opacity: 0;
}
.signedInText,
.notSignedInText {
position: absolute;
padding-top: 0.8rem;
left: 1rem;
right: 6.5rem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: inherit;
z-index: 1;
line-height: 1.3rem;
}
.signedInText {
padding-top: 0rem;
left: 4.6rem;
}
.avatar {
border-radius: 2rem;
float: left;
height: 2.8rem;
width: 2.8rem;
background-color: white;
background-size: cover;
background-repeat: no-repeat;
}
.button,
.buttonPrimary {
float: right;
margin-right: -0.4rem;
font-weight: 500;
border-radius: 0.3rem;
cursor: pointer;
font-size: 1rem;
line-height: 1.4rem;
padding: 0.7rem 0.8rem;
position: relative;
z-index: 10;
background-color: transparent;
color: #555;
}
.buttonPrimary {
background-color: #346df1;
border-color: #346df1;
color: #fff;
text-decoration: none;
padding: 0.7rem 1.4rem;
}
.buttonPrimary:hover {
box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.2);
}
.navItems {
margin-bottom: 2rem;
padding: 0;
list-style: none;
}
.navItem {
display: inline-block;
margin-right: 1rem;
}

View File

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

View File

@@ -0,0 +1,45 @@
export { default } from "next-auth/middleware"
export const config = { matcher: ["/middleware-protected"] }
// Other ways to use this middleware
// import withAuth from "next-auth/middleware"
// import { withAuth } from "next-auth/middleware"
// export function middleware(req, ev) {
// return withAuth(req)
// }
// export function middleware(req, ev) {
// return withAuth(req, ev)
// }
// export function middleware(req, ev) {
// return withAuth(req, {
// callbacks: {
// authorized: ({ token }) => !!token,
// },
// })
// }
// export default withAuth(function middleware(req, ev) {
// console.log(req.nextauth.token)
// })
// export default withAuth(
// function middleware(req, ev) {
// console.log(req, ev)
// },
// {
// callbacks: {
// authorized: ({ token }) => token.name === "Balázs Orbán",
// },
// }
// )
// export default withAuth({
// callbacks: {
// authorized: ({ token }) => !!token,
// },
// })

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

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

View File

@@ -0,0 +1,9 @@
/** @type {import("next").NextConfig} */
module.exports = {
webpack(config) {
config.experiments = { ...config.experiments, topLevelAwait: true }
return config
},
experimental: { appDir: true },
typescript: { ignoreBuildErrors: true },
}

View File

@@ -0,0 +1,43 @@
{
"name": "next-auth-app",
"version": "1.0.0",
"description": "Next.js + Auth.js Developer app",
"private": true,
"scripts": {
"clean": "rm -rf .next",
"dev": "next dev",
"build": "next build",
"start": "next start",
"email": "fake-smtp-server",
"start:email": "pnpm email",
"e2e": "pnpm dlx playwright test"
},
"license": "ISC",
"dependencies": {
"@auth/core": "workspace:*",
"@auth/fauna-adapter": "workspace:*",
"@auth/prisma-adapter": "workspace:*",
"@auth/supabase-adapter": "workspace:*",
"@auth/typeorm-adapter": "workspace:*",
"@prisma/client": "^3",
"@supabase/supabase-js": "^2.0.5",
"faunadb": "^4",
"next": "13.4.0",
"next-auth": "workspace:*",
"nodemailer": "^6",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@playwright/test": "1.29.2",
"@types/jsonwebtoken": "^8.5.5",
"@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"
}
}

View File

@@ -0,0 +1,10 @@
import { SessionProvider } from "next-auth/react"
import "./styles.css"
export default function App({ Component, pageProps }) {
return (
<SessionProvider session={pageProps.session}>
<Component {...pageProps} />
</SessionProvider>
)
}

View File

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

View File

@@ -0,0 +1,165 @@
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"
import Facebook from "@auth/core/providers/facebook"
import Foursquare from "@auth/core/providers/foursquare"
import Freshbooks from "@auth/core/providers/freshbooks"
import GitHub from "@auth/core/providers/github"
import Gitlab from "@auth/core/providers/gitlab"
import Google from "@auth/core/providers/google"
// import IDS4 from "@auth/core/providers/identity-server4"
import Instagram from "@auth/core/providers/instagram"
// import Keycloak from "@auth/core/providers/keycloak"
import Line from "@auth/core/providers/line"
import LinkedIn from "@auth/core/providers/linkedin"
import Mailchimp from "@auth/core/providers/mailchimp"
import 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"
import Slack from "@auth/core/providers/slack"
import Spotify from "@auth/core/providers/spotify"
import Trakt from "@auth/core/providers/trakt"
import Twitch from "@auth/core/providers/twitch"
import Twitter from "@auth/core/providers/twitter"
import 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"
// // Prisma
// import { PrismaClient } from "@prisma/client"
// 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 "@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 { TypeORMAdapter } from "@auth/typeorm-adapter"
// const adapter = TypeORMAdapter({
// type: "sqlite",
// name: "next-auth-test-memory",
// database: "./typeorm/dev.db",
// synchronize: true,
// })
// // Supabase
// import { SupabaseAdapter } from "@auth/supabase-adapter"
// const adapter = SupabaseAdapter({
// url: process.env.NEXT_PUBLIC_SUPABASE_URL,
// secret: process.env.SUPABASE_SERVICE_ROLE_KEY,
// })
export const authConfig: AuthConfig = {
// adapter,
debug: process.env.NODE_ENV !== "production",
theme: {
logo: "https://next-auth.js.org/img/logo/logo-sm.png",
brandColor: "#1786fb",
},
providers: [
Credentials({
credentials: { password: { label: "Password", type: "password" } },
async authorize(credentials) {
if (credentials.password !== "pw") return null
return { name: "Fill Murray", email: "bill@fillmurray.com", image: "https://www.fillmurray.com/64/64", id: "1", foo: "" }
},
}),
Apple({ clientId: process.env.APPLE_ID, clientSecret: process.env.APPLE_SECRET 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,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET,
tenantId: process.env.AZURE_AD_TENANT_ID,
}),
AzureB2C({ clientId: process.env.AZURE_B2C_ID, clientSecret: process.env.AZURE_B2C_SECRET, issuer: process.env.AZURE_B2C_ISSUER }),
// 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, 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 }),
Instagram({ clientId: process.env.INSTAGRAM_ID, clientSecret: process.env.INSTAGRAM_SECRET }),
// Keycloak({ clientId: process.env.KEYCLOAK_ID, clientSecret: process.env.KEYCLOAK_SECRET, issuer: process.env.KEYCLOAK_ISSUER }),
Line({ clientId: process.env.LINE_ID, clientSecret: process.env.LINE_SECRET }),
LinkedIn({ clientId: process.env.LINKEDIN_ID, clientSecret: process.env.LINKEDIN_SECRET }),
Mailchimp({ clientId: process.env.MAILCHIMP_ID, clientSecret: process.env.MAILCHIMP_SECRET }),
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 }),
Slack({ clientId: process.env.SLACK_ID, clientSecret: process.env.SLACK_SECRET }),
Spotify({ clientId: process.env.SPOTIFY_ID, clientSecret: process.env.SPOTIFY_SECRET }),
Trakt({ clientId: process.env.TRAKT_ID, clientSecret: process.env.TRAKT_SECRET }),
Twitch({ clientId: process.env.TWITCH_ID, clientSecret: process.env.TWITCH_SECRET }),
Twitter({ clientId: process.env.TWITTER_ID, clientSecret: process.env.TWITTER_SECRET }),
// TwitterLegacy({ clientId: process.env.TWITTER_LEGACY_ID, clientSecret: process.env.TWITTER_LEGACY_SECRET }),
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 }),
],
// debug: process.env.NODE_ENV !== "production",
}
if (authConfig.adapter) {
// TODO:
// authOptions.providers.unshift(
// // NOTE: You can start a fake e-mail server with `pnpm email`
// // and then go to `http://localhost:1080` in the browser
// Email({ server: "smtp://127.0.0.1:1025?tls.rejectUnauthorized=false" })
// )
}
// TODO: move to next-auth/edge
function AuthHandler(...args: any[]) {
const envSecret = process.env.AUTH_SECRET ?? process.env.NEXTAUTH_SECRET
const envTrustHost = !!(process.env.NEXTAUTH_URL ?? process.env.AUTH_TRUST_HOST ?? process.env.VERCEL ?? process.env.NODE_ENV !== "production")
if (args.length === 1) {
return async (req: Request) => {
args[0].secret ??= envSecret
args[0].trustHost ??= envTrustHost
return Auth(req, args[0])
}
}
args[1].secret ??= envSecret
args[1].trustHost ??= envTrustHost
return Auth(args[0], args[1])
}
export default AuthHandler(authConfig)
export const config = { runtime: "edge" }

View File

@@ -0,0 +1,7 @@
// This is an example of how to read a JSON Web Token from an API route
import { getToken } from "next-auth/jwt"
export default async (req, res) => {
const token = await getToken({ req })
res.send(JSON.stringify(token, null, 2))
}

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