Skip to content

Commit c475ad4

Browse files
authored
CG-6243: Review, fix issue and refactor (#43)
# CG-6243: Review, fix issue and refactor * Add debug config file * move refreshAccessToken function to oauth.ts * refreshAccessToken changes: * * change param from query string to request body -> this fix the issue that cause bad request to token endpoint * * the token contains provider to detect proper providerConfig * * remove `clientSecret` from `okta` and `optimizely_cms` because it causes to bad request. Those two providers don't need clientSecret * nextauth.ts changes: * * move accessTokenParse to EpiserverOIDCProvider * * `accessTokenExpires` is calculated as `account.expires_at * 1000` because expires_in is not existing in the account. * Remove redundant code ## Issue: * The jwt callback or refreshAccessToken is triggered twice and that last jwt callback still holds the old token value. However the session is up to date so we can skip this issue at the moment. nextauthjs/next-auth#1455
1 parent 01c704c commit c475ad4

File tree

8 files changed

+247
-943
lines changed

8 files changed

+247
-943
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Next.js: debug server-side",
6+
"type": "node-terminal",
7+
"request": "launch",
8+
"command": "npm run dev"
9+
},
10+
{
11+
"name": "Next.js: debug client-side",
12+
"type": "chrome",
13+
"request": "launch",
14+
"url": "http://localhost:3000"
15+
},
16+
{
17+
"name": "Next.js: debug full stack",
18+
"type": "node-terminal",
19+
"request": "launch",
20+
"command": "npm run dev",
21+
"serverReadyAction": {
22+
"pattern": "- Local:.+(https?://.+)",
23+
"uriFormat": "%s",
24+
"action": "debugWithChrome"
25+
}
26+
}
27+
]
28+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const prod = process.env.NODE_ENV === 'production'
2+
export const baseUrl = prod ? process.env.NEXTAUTH_URL : (process.env.VERCEL_URL ?? process.env.NEXTAUTH_URL)

0 commit comments

Comments
 (0)