File tree Expand file tree Collapse file tree 4 files changed +17
-18
lines changed
lib/actions/callback/oauth Expand file tree Collapse file tree 4 files changed +17
-18
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Google from "next-auth/providers/google"
5
5
import Facebook from "next-auth/providers/facebook"
6
6
import Twitter from "next-auth/providers/twitter"
7
7
import Keycloak from "next-auth/providers/keycloak"
8
+ import LinkedIn from "next-auth/providers/linkedin"
8
9
9
10
declare module "next-auth" {
10
11
/**
@@ -41,20 +42,13 @@ export default {
41
42
Keycloak ,
42
43
Facebook ,
43
44
Twitter ,
45
+ LinkedIn ,
44
46
] . filter ( Boolean ) as NextAuthConfig [ "providers" ] ,
45
47
callbacks : {
46
48
jwt ( { token, trigger, session } ) {
47
49
if ( trigger === "update" ) token . name = session . user . name
48
50
return token
49
51
} ,
50
- async session ( { session, token } ) {
51
- return {
52
- ...session ,
53
- user : {
54
- ...token ,
55
- } ,
56
- }
57
- } ,
58
52
} ,
59
53
basePath : "/auth" ,
60
54
} satisfies NextAuthConfig
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ export function Header({
16
16
< div className = { styles . signedInStatus } >
17
17
< img
18
18
src = {
19
- session ?. user ?. image ?? "https://source.boringavatars.com/beam/120"
19
+ session ?. user ?. image ??
20
+ "https://source.boringavatars.com/marble/120"
20
21
}
21
22
className = { styles . avatar }
22
23
/>
Original file line number Diff line number Diff line change @@ -109,7 +109,18 @@ export async function handleOAuth(
109
109
client ,
110
110
codeGrantParams ,
111
111
redirect_uri ,
112
- codeVerifier ?? "auth" // TODO: review fallback code verifier
112
+ codeVerifier ?? "auth" , // TODO: review fallback code verifier,
113
+ {
114
+ [ o . experimental_customFetch ] : ( ...args ) => {
115
+ if (
116
+ ! provider . checks . includes ( "pkce" ) &&
117
+ args [ 1 ] ?. body instanceof URLSearchParams
118
+ ) {
119
+ args [ 1 ] . body . delete ( "code_verifier" )
120
+ }
121
+ return fetch ( ...args )
122
+ } ,
123
+ }
113
124
)
114
125
115
126
if ( provider . token ?. conform ) {
Original file line number Diff line number Diff line change @@ -79,15 +79,8 @@ export default function LinkedIn<P extends LinkedInProfile>(
79
79
type : "oidc" ,
80
80
client : { token_endpoint_auth_method : "client_secret_post" } ,
81
81
issuer : "https://www.linkedin.com/oauth" ,
82
- async profile ( profile ) {
83
- return {
84
- id : profile . sub ,
85
- name : profile . name ,
86
- email : profile . email ,
87
- image : profile . picture ,
88
- }
89
- } ,
90
82
style : { bg : "#069" , text : "#fff" } ,
83
+ checks : [ "state" ] ,
91
84
options,
92
85
}
93
86
}
You can’t perform that action at this time.
0 commit comments