File tree Expand file tree Collapse file tree
packages/auth/src/configs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 bearer ,
88 magicLink ,
99 multiSession ,
10+ oAuthProxy ,
1011 oneTap ,
1112 openAPI ,
1213 organization ,
@@ -111,6 +112,8 @@ export const DEVELOPMENT_ORIGINS = [
111112
112113export const MAX_SESSIONS = 2 ;
113114
115+ const USE_OAUTH_PROXY = true ;
116+
114117const getBaseURL = ( envUrl : string | undefined ) : string => {
115118 try {
116119 if ( ! envUrl ) {
@@ -205,6 +208,14 @@ export function createAuthConfig(env: Env) {
205208 } ,
206209 } ,
207210 plugins : [
211+ ...( USE_OAUTH_PROXY
212+ ? [
213+ oAuthProxy ( {
214+ currentURL : baseAuthURL ,
215+ productionURL : appURL ,
216+ } ) ,
217+ ]
218+ : [ ] ) ,
208219 admin ( ) ,
209220 oneTap ( ) ,
210221 bearer ( ) ,
@@ -358,10 +369,16 @@ export function createAuthConfig(env: Env) {
358369 github : {
359370 clientId : env . GITHUB_CLIENT_ID ,
360371 clientSecret : env . GITHUB_CLIENT_SECRET ,
372+ redirectURI : USE_OAUTH_PROXY
373+ ? `${ baseAuthURL } /api/auth/callback/github`
374+ : undefined ,
361375 } ,
362376 google : {
363377 clientId : env . NEXT_PUBLIC_GOOGLE_CLIENT_ID ,
364378 clientSecret : env . GOOGLE_CLIENT_SECRET ,
379+ redirectURI : USE_OAUTH_PROXY
380+ ? `${ baseAuthURL } /api/auth/callback/google`
381+ : undefined ,
365382 } ,
366383 } ,
367384 account : {
You can’t perform that action at this time.
0 commit comments