Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nextjs): introduce next-auth v5 #7443

Merged
merged 339 commits into from
Oct 24, 2023
Merged
Changes from 3 commits
Commits
Show all changes
339 commits
Select commit Hold shift + click to select a range
46f622a
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 4, 2023
c411c6f
update gitignore
balazsorban44 May 4, 2023
18a4e8b
update turbo
balazsorban44 May 4, 2023
440317a
update turbo
balazsorban44 May 4, 2023
52c04fe
update turbo
balazsorban44 May 4, 2023
3c23a4f
add docs
balazsorban44 May 4, 2023
6f5a503
chore: use `@ts-ignore`
balazsorban44 May 4, 2023
c47a2eb
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 4, 2023
a7991ae
revert
balazsorban44 May 4, 2023
0b80c65
update lock file
balazsorban44 May 4, 2023
d6bc65f
chore: support release any package as experimental
balazsorban44 May 4, 2023
0afb179
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 4, 2023
99247ce
chore: separate manual release job
balazsorban44 May 4, 2023
7fae874
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 4, 2023
e0b5f18
chore: skip test for manual release
balazsorban44 May 4, 2023
601c8c9
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 4, 2023
eaf5080
chore: tweak
balazsorban44 May 4, 2023
8f40883
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 4, 2023
aaff906
add readme
balazsorban44 May 4, 2023
e4d568c
fix redirects
balazsorban44 May 4, 2023
8f416b6
chore: tweaks
balazsorban44 May 4, 2023
587d366
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 4, 2023
65fe0ef
fix imports
balazsorban44 May 4, 2023
3ba510c
forward all `set-cookie` headers
balazsorban44 May 4, 2023
af81776
upgrade dev app
balazsorban44 May 4, 2023
8cfd1ae
improve docs
balazsorban44 May 5, 2023
c470960
docs
balazsorban44 May 5, 2023
7da3256
docs
balazsorban44 May 5, 2023
b17c5de
add installation
balazsorban44 May 5, 2023
24e8100
move
balazsorban44 May 5, 2023
5fb4caa
whitespace
balazsorban44 May 5, 2023
b96f013
chore: tweak manual release version
balazsorban44 May 5, 2023
b17dc76
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 5, 2023
436d46a
tweak docs
balazsorban44 May 5, 2023
bb4d5ce
update dev app
balazsorban44 May 5, 2023
bac8b8d
add `getServerSession`, simplify `auth()` return
balazsorban44 May 5, 2023
a7e0226
fix value
balazsorban44 May 5, 2023
50bf545
feat(docs): add upgrdae-to-v5.md page
ndom91 May 7, 2023
df1e557
don't require passing `headers()` to `auth()`
balazsorban44 May 7, 2023
bf10ef2
remove `getServerSession`
balazsorban44 May 7, 2023
26122b4
fix passing req to `fetchData`
balazsorban44 May 7, 2023
95c80b4
Merge branch 'feat/nextjs-auth' of github.com:nextauthjs/next-auth in…
balazsorban44 May 7, 2023
9212654
fix(docs): markdwon table for API changes
ndom91 May 7, 2023
53e2c60
Merge branch 'feat/nextjs-auth' of ssh://github.com/nextauthjs/next-a…
ndom91 May 7, 2023
61ec4f3
rename react to client
balazsorban44 May 7, 2023
96f0ea2
fix(docs): clean up API table formatting
ndom91 May 7, 2023
5f9f473
update dev app
balazsorban44 May 7, 2023
9e14bb3
Merge branch 'feat/nextjs-auth' of github.com:nextauthjs/next-auth in…
balazsorban44 May 7, 2023
681a8b6
fix: clean up table and add links
ndom91 May 7, 2023
e8a2b36
feat(docs): add example routes and more breaking changes to upgrade-v…
ndom91 May 7, 2023
b4028bd
fix: minor wording changes
ndom91 May 8, 2023
f00ac78
chore: reduce breaking changes on Account mapping
balazsorban44 May 10, 2023
7ffd361
chore: add build to manual publish
balazsorban44 May 10, 2023
e8b4839
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 10, 2023
a7aafb3
Merge branch 'feat/nextjs-auth' of github.com:nextauthjs/next-auth in…
balazsorban44 May 10, 2023
c336b10
chore: move build to root
balazsorban44 May 10, 2023
c8a8706
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 10, 2023
ceeb255
feat: add update session to core
balazsorban44 May 10, 2023
66d7179
Merge branch 'feat/update-session-core' into feat/nextjs-auth
balazsorban44 May 10, 2023
f5de6cf
docs(example): update broken link (#7504)
remirobichet May 10, 2023
5f0e00c
resolve default user after jwt callback
balazsorban44 May 10, 2023
8b0276c
Merge branch 'feat/update-session-core' into feat/nextjs-auth
balazsorban44 May 10, 2023
af5df4c
test update
balazsorban44 May 10, 2023
344346c
fix syntax
balazsorban44 May 10, 2023
cca94bf
feat: add update session to core (#7505)
balazsorban44 May 10, 2023
ca5f5bd
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 10, 2023
7f4d81e
tweak docs
balazsorban44 May 11, 2023
7cd3bad
support Node.js-like environment with `getServerSession`
balazsorban44 May 11, 2023
c53b9f7
update dev app
balazsorban44 May 11, 2023
b826c64
merge `getServerSession` and `auth`
balazsorban44 May 11, 2023
3641972
update dev app
balazsorban44 May 11, 2023
1a6b971
migration guide tweaks
balazsorban44 May 11, 2023
3c5ae44
tweak migration guide
balazsorban44 May 11, 2023
ee746cb
empty commit
balazsorban44 May 11, 2023
6960271
more migration guide tweaks
balazsorban44 May 11, 2023
fbe6bd9
more migration guide
balazsorban44 May 11, 2023
a9b6a63
more migration
balazsorban44 May 11, 2023
375b93c
mention `getToken` in migration
balazsorban44 May 11, 2023
7b09c07
note on `session()` callback
balazsorban44 May 11, 2023
9c02d5f
move note
balazsorban44 May 11, 2023
af30f4e
move
balazsorban44 May 11, 2023
53005b9
cleanup, add comment
balazsorban44 May 11, 2023
c8b1951
add todo
balazsorban44 May 11, 2023
88f632a
revert to image
balazsorban44 May 12, 2023
f62c016
chore: revert `picture` to `image`
balazsorban44 May 12, 2023
7f3ea8f
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 12, 2023
e4c1665
revert to image
balazsorban44 May 12, 2023
49fe943
revert
balazsorban44 May 12, 2023
d30c21d
mention env variable inferring
balazsorban44 May 12, 2023
3a0f8f3
mention extra fields for database migrations
balazsorban44 May 12, 2023
91fd5f3
fix server component migration
balazsorban44 May 12, 2023
785513e
fix when there is no user-defined callbacks
balazsorban44 May 13, 2023
358caac
add `NextAuthOptions`
balazsorban44 May 14, 2023
ecae35f
mention edge-compatibility
balazsorban44 May 14, 2023
d2543e9
fix page
balazsorban44 May 14, 2023
f62ea8d
remove credentials from examples
balazsorban44 May 14, 2023
b6329dc
autogenerate provider imports
balazsorban44 May 15, 2023
35d9668
fix default export
balazsorban44 May 15, 2023
406e54b
change exports
balazsorban44 May 15, 2023
1ef77a3
publish providers
balazsorban44 May 15, 2023
1f0c2f4
tweak migration guide
balazsorban44 May 15, 2023
91d787b
mention `@auth/core` in breaking changes
balazsorban44 May 15, 2023
789ec13
mention panva in contributors
balazsorban44 May 15, 2023
d8bf293
drop async
balazsorban44 May 15, 2023
e3b5f7c
old/new -> v4/v5
balazsorban44 May 15, 2023
4bf6f73
tweak env inferring docs
balazsorban44 May 15, 2023
927e3a2
make re-export a one-liner
balazsorban44 May 15, 2023
3dc71ac
tweak
balazsorban44 May 15, 2023
0c0061b
drop `@auth/core` from dev app
balazsorban44 May 15, 2023
c5818fe
fix default signin redirect if unauthorized
balazsorban44 May 15, 2023
ed159a0
move upgrade guide to guides
balazsorban44 May 15, 2023
6f89341
add adapter types to migration guide
balazsorban44 May 18, 2023
313f0b7
use NextAuthConfig in env defaults
balazsorban44 May 18, 2023
c5a9b4e
upgrade `next`
balazsorban44 May 18, 2023
2bdf9cf
more specific migration guide links
balazsorban44 May 18, 2023
e69edb7
re-export `NextAuthOptions`
balazsorban44 May 18, 2023
77e45ed
redirect protection for default, `pages` config, NEXTAUTH_URL routes
balazsorban44 May 18, 2023
152ac49
update dev app
balazsorban44 May 18, 2023
220ee41
chore: Move next.config.js file into the correct directory (#7580)
ghoshnirmalya May 18, 2023
4baf2c8
docs: Cypress.Cookies.defaults removed (#7574)
roy9495 May 18, 2023
61dcddf
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 19, 2023
eeec27f
add `CSRF_experimental`
balazsorban44 May 19, 2023
e53f08e
add database to dev app
balazsorban44 May 19, 2023
bc3ba23
Merge branch 'feat/nextjs-auth' of github.com:nextauthjs/next-auth in…
balazsorban44 May 19, 2023
8373bc9
feat: allow empty `account` mapper
balazsorban44 May 19, 2023
7711eb0
Merge branch 'main' of github.com:nextauthjs/next-auth
balazsorban44 May 19, 2023
d52cd83
Merge branch 'main' into feat/nextjs-auth
balazsorban44 May 19, 2023
d28748b
add comment
balazsorban44 May 19, 2023
3e354fb
expose types
balazsorban44 May 19, 2023
8470744
tweak docs
balazsorban44 May 19, 2023
d111c4d
capitalize
balazsorban44 May 19, 2023
d9a9c57
Apply suggestions from code review
balazsorban44 May 22, 2023
1baad29
tweaks
balazsorban44 May 22, 2023
3f1e0de
fix Route Handler wrapper
balazsorban44 May 22, 2023
11a0e87
fix dev app
balazsorban44 May 22, 2023
a45b278
redirect back to original page after auth
balazsorban44 May 22, 2023
531c5b5
prevent infinite loop on default signin page
balazsorban44 May 22, 2023
030e832
spread session
balazsorban44 May 22, 2023
e040925
update dev app
balazsorban44 May 22, 2023
f625b14
tweaks
balazsorban44 May 22, 2023
39d2806
rephrase, typos
balazsorban44 May 22, 2023
2baf082
update example
balazsorban44 May 22, 2023
de81bb7
tweak docs, remove unused import
balazsorban44 May 23, 2023
62eb457
docs: Update TypeDoc plugins and tweak config (#7653)
tgreyuk May 29, 2023
4989ee3
Update docs/docs/guides/upgrade-to-v5.md
balazsorban44 May 29, 2023
9699746
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 7, 2023
223c646
fix: swallow `BroadcastChannel` missing Next.js error
balazsorban44 Jun 13, 2023
4bb3d41
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 13, 2023
e57e58a
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 13, 2023
5d38692
set up `@auth/nextjs` -> `next-auth` aliasing
balazsorban44 Jun 13, 2023
942f037
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 13, 2023
a6eec2f
fix(docs): Fixed TypeDoc index paths (#7796)
tgreyuk Jun 14, 2023
fdb8ea5
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 14, 2023
722c34b
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 14, 2023
2044689
fix re-export
balazsorban44 Jun 16, 2023
b7162c8
re-rexport default
balazsorban44 Jun 16, 2023
4cd21ea
correct submodule
balazsorban44 Jun 16, 2023
d211b08
re-export types
balazsorban44 Jun 16, 2023
20cbb16
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 16, 2023
198bb20
add docs, bump `next`
balazsorban44 Jun 16, 2023
de74436
update package.json
balazsorban44 Jun 16, 2023
8045eba
properly re-export types
balazsorban44 Jun 16, 2023
f414f2f
use experimental channel
balazsorban44 Jun 20, 2023
9559128
upgrade prisma
balazsorban44 Jun 20, 2023
fd28db0
move imports
balazsorban44 Jun 20, 2023
b53ca00
fix dev dependencies
balazsorban44 Jun 20, 2023
e65faa1
remove `@auth/core` as `next-auth` dependency
balazsorban44 Jun 20, 2023
09d3ce3
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 22, 2023
b9562eb
fix import
balazsorban44 Jun 22, 2023
47dfbcd
fix import (again)
balazsorban44 Jun 22, 2023
1309ee9
always detect secure cookies environment
balazsorban44 Jun 22, 2023
64da9ea
revert
balazsorban44 Jun 22, 2023
179c08d
correctly detect protocol
balazsorban44 Jun 22, 2023
67f3f31
fix typo
balazsorban44 Jun 27, 2023
c1121d9
move `@auth/nextjs` to `next-auth`
balazsorban44 Jun 27, 2023
f438300
rename pr label
balazsorban44 Jun 27, 2023
54b4f96
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jun 27, 2023
db882e1
update lock file
balazsorban44 Jun 27, 2023
22bd11b
fix indent
balazsorban44 Jun 27, 2023
4306402
tweak migration guide
balazsorban44 Jun 27, 2023
61f9ef7
tweak docs
balazsorban44 Jun 27, 2023
83c4ebd
tweak docs
balazsorban44 Jun 27, 2023
62b9e3f
upgrade next
balazsorban44 Jun 27, 2023
790f761
remove `next-autg/adapters`
balazsorban44 Jun 27, 2023
9d13d2a
remove v4 dev, update next
balazsorban44 Jul 18, 2023
488467f
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jul 18, 2023
a5a33e5
fix: do not mutate `config`
balazsorban44 Jul 25, 2023
d095234
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Jul 25, 2023
b345135
doc: address review comments in preview
ThangHuuVu Jul 27, 2023
7f33971
doc: update migration guide
ThangHuuVu Jul 29, 2023
07b9578
doc: add tab bars
ThangHuuVu Jul 30, 2023
2196ee2
doc: tweak files
ThangHuuVu Jul 30, 2023
28b2bdf
doc: add tips about AUTH_SECRET
ThangHuuVu Jul 30, 2023
f53b5d9
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Aug 10, 2023
11be831
remove static env variable expansion
balazsorban44 Aug 10, 2023
160d77d
upgrade Next.js
balazsorban44 Aug 10, 2023
024ba3e
respect `AUTH_URL` and `NEXTAUTH_URL`
balazsorban44 Aug 10, 2023
bf3b483
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Aug 11, 2023
1815cd1
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Aug 12, 2023
82b6f7a
update dev app
balazsorban44 Aug 14, 2023
3852789
implement `signIn` and `signOut` server actions
balazsorban44 Aug 14, 2023
ffd0553
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Aug 14, 2023
5749b09
fix: rm .js from imports (#8669)
juliusmarminge Sep 22, 2023
e36c4c6
feat: update v5 example (#8735)
ThangHuuVu Sep 27, 2023
5648658
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Sep 27, 2023
8aab91b
use server actions
balazsorban44 Sep 27, 2023
ed741bb
update deps
balazsorban44 Sep 27, 2023
c5575f3
tweaks
balazsorban44 Sep 27, 2023
3969246
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Sep 27, 2023
e776ccd
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Sep 27, 2023
b6445e4
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Sep 27, 2023
5984468
fix docs
balazsorban44 Sep 27, 2023
377625f
package.json tweaks
balazsorban44 Sep 27, 2023
7f41a08
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Sep 27, 2023
f127da6
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Sep 27, 2023
36f8e00
bump react types, fix type issues
balazsorban44 Sep 28, 2023
ffc584e
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Sep 28, 2023
289c490
add update action
balazsorban44 Sep 28, 2023
058cb54
bump next to canary
balazsorban44 Sep 28, 2023
908be23
simplify example
balazsorban44 Sep 28, 2023
27bcf0f
fix types and paths
balazsorban44 Sep 28, 2023
3587e16
return null if no session
balazsorban44 Sep 28, 2023
68f7ce1
fix links
balazsorban44 Sep 28, 2023
37865b6
simplify example
balazsorban44 Sep 28, 2023
f2c23db
fix: add getSetCookie to session cookies if supported (#8631)
edenstrom Sep 29, 2023
70a585c
simplify
balazsorban44 Sep 29, 2023
c885ac1
bump typescript
balazsorban44 Sep 29, 2023
7264de5
ignore supabase test
ThangHuuVu Oct 7, 2023
bc36c80
refactor `signIn` and `signOut` methods
balazsorban44 Oct 11, 2023
2304529
fix urls
balazsorban44 Oct 11, 2023
4c69001
support credentials, add docs
balazsorban44 Oct 11, 2023
c8300b6
remove dupicate docs
balazsorban44 Oct 11, 2023
76e382b
docs
balazsorban44 Oct 11, 2023
21555b3
indent
balazsorban44 Oct 11, 2023
dacbe24
handle errors, support auth params
balazsorban44 Oct 12, 2023
caf5cbf
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Oct 23, 2023
a153986
infer provider env vars even if a function form is provided
balazsorban44 Oct 23, 2023
c65ee02
remove redundant useSecureCookies flag setting
balazsorban44 Oct 23, 2023
e68cde9
bump `next`
balazsorban44 Oct 23, 2023
d41e373
simplify Prisma instatation
balazsorban44 Oct 23, 2023
3dd91f8
upgrade migration files
balazsorban44 Oct 23, 2023
b74d3e8
run user's `session` callback if defined, even on server
balazsorban44 Oct 23, 2023
8dbcd25
use `Session` instead of `AuthSession`
balazsorban44 Oct 23, 2023
5fecd19
add server action `update`
balazsorban44 Oct 23, 2023
05243b5
Merge branch 'main' into feat/nextjs-auth
balazsorban44 Oct 23, 2023
80c02bf
add jwt callback to update session
balazsorban44 Oct 23, 2023
73af7ab
fix example
balazsorban44 Oct 23, 2023
1c3584f
remove empty line
balazsorban44 Oct 23, 2023
dcd746c
drop `serverActions: true` flag
balazsorban44 Oct 23, 2023
cfb42ae
bump lock file
balazsorban44 Oct 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/lib/callback-handler.ts
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ export async function handleLogin(
const { provider: p } = options as InternalOptions<"oauth" | "oidc">
const { type, provider, providerAccountId, userId, ...tokenSet } = account
const defaults = { providerAccountId, provider, type, userId }
account = Object.assign(p.account(tokenSet), defaults)
account = Object.assign(p.account(tokenSet) ?? {}, defaults)

if (user) {
// If the user is already signed in and the OAuth account isn't already associated
2 changes: 1 addition & 1 deletion packages/core/src/providers/oauth.ts
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ export type ProfileCallback<Profile> = (
tokens: TokenSet
) => Awaitable<User>

export type AccountCallback = (tokens: TokenSet) => TokenSet
export type AccountCallback = (tokens: TokenSet) => TokenSet | undefined | void

export interface OAuthProviderButtonStyles {
logo: string