Skip to content

Commit cba4781

Browse files
committed
pkg:auth:fix update OAuth proxy handling and adjust cookie attributes for development environment
1 parent 29a50b0 commit cba4781

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

packages/auth/src/configs/auth.config.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export const DEVELOPMENT_ORIGINS = [
128128

129129
export const MAX_SESSIONS = 2;
130130

131+
// BUG: OAUTH PROXY CURRENTLY DOES NOT WORK IN LOCALHOST WITH AUTH WORKER
131132
const USE_OAUTH_PROXY = true;
132133

133134
const getBaseURL = (envUrl: string | undefined): string => {
@@ -377,11 +378,12 @@ export function createAuthConfig(env: Env) {
377378
google: {
378379
clientId: env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
379380
clientSecret: env.GOOGLE_CLIENT_SECRET,
380-
redirectURI: USE_OAUTH_PROXY
381-
? useAuthWorker
382-
? `${PROD_AUTH_WORKER_URL}/api/auth/callback/google`
383-
: `${PROD_APP_URL}/api/auth/callback/google`
384-
: undefined,
381+
// GOOGLE AUTH SUPPORTS MORE THAN ONE REDIRECT URI, SO WE DON'T NEED TO USE THE PROXY
382+
// redirectURI: USE_OAUTH_PROXY
383+
// ? useAuthWorker
384+
// ? `${PROD_AUTH_WORKER_URL}/api/auth/callback/google`
385+
// : `${PROD_APP_URL}/api/auth/callback/google`
386+
// : undefined,
385387
},
386388
},
387389
account: {
@@ -403,7 +405,7 @@ export function createAuthConfig(env: Env) {
403405
domain: isDevelopment ? 'localhost' : '.deepcrawl.dev',
404406
},
405407
defaultCookieAttributes: {
406-
partitioned: true, // New browser standards will mandate this for foreign cookies
408+
partitioned: isDevelopment ? undefined : true, // New browser standards will mandate this for foreign cookies
407409
},
408410
},
409411
rateLimit: {

0 commit comments

Comments
 (0)