···8 // Get the ngrok URL from environment variables
9 const ngrokUrl = env.NGROK_URL
1011- if (!ngrokUrl) {
12 console.warn(
13 'WARNING: NGROK_URL is not set. OAuth login might not work properly.',
14 )
···16 'You should run ngrok and set the NGROK_URL environment variable.',
17 )
18 console.warn('Example: NGROK_URL=https://abcd-123-45-678-90.ngrok.io')
0019 }
2021- // The base URL is either the ngrok URL (preferred) or a local URL as fallback
22- const baseUrl = ngrokUrl || `http://127.0.0.1:${env.PORT}`
2324 return new NodeOAuthClient({
25 clientMetadata: {
···8 // Get the ngrok URL from environment variables
9 const ngrokUrl = env.NGROK_URL
1011+ if (!ngrokUrl && env.NODE_ENV === 'development') {
12 console.warn(
13 'WARNING: NGROK_URL is not set. OAuth login might not work properly.',
14 )
···16 'You should run ngrok and set the NGROK_URL environment variable.',
17 )
18 console.warn('Example: NGROK_URL=https://abcd-123-45-678-90.ngrok.io')
19+ } else if (env.NODE_ENV === 'production' && !env.PUBLIC_URL) {
20+ throw new Error('PUBLIC_URL is not set')
21 }
2223+ const baseUrl = ngrokUrl || env.PUBLIC_URL || `http://127.0.0.1:${env.PORT}`
02425 return new NodeOAuthClient({
26 clientMetadata: {