File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,18 @@ export const authConfig: NextAuthConfig = {
3131 scope : "openid profile email" ,
3232 } ,
3333 } ,
34- token : "https://slack.com/api/openid.connect.token" ,
34+ token : {
35+ url : "https://slack.com/api/openid.connect.token" ,
36+ async conform ( response : Response ) {
37+ const data = await response . json ( ) ;
38+ // Strip id_token — Slack's OIDC returns a broken nonce, and Auth.js
39+ // tries to validate it even with type "oauth". Removing it forces
40+ // Auth.js to use the userinfo endpoint instead.
41+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
42+ const { id_token, ...rest } = data ;
43+ return Response . json ( rest ) ;
44+ } ,
45+ } ,
3546 userinfo : "https://slack.com/api/openid.connect.userInfo" ,
3647 profile ( profile ) {
3748 return {
You can’t perform that action at this time.
0 commit comments