File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11import { withSentryConfig } from '@sentry/nextjs'
22import type { NextConfig } from 'next'
3- import { env , isTruthy } from './lib/env'
3+ import { env , getEnv , isTruthy } from './lib/env'
44import { isDev , isHosted , isProd } from './lib/environment'
55import { getMainCSPPolicy , getWorkflowExecutionCSPPolicy } from './lib/security/csp'
66
@@ -187,18 +187,20 @@ const nextConfig: NextConfig = {
187187 async redirects ( ) {
188188 const redirects = [ ]
189189 // Add whitelabel redirects for terms and privacy pages if external URLs are configured
190- if ( env . NEXT_PUBLIC_TERMS_URL ?. startsWith ( 'http' ) ) {
190+ const termsUrl = getEnv ( 'NEXT_PUBLIC_TERMS_URL' )
191+ if ( termsUrl ?. startsWith ( 'http' ) ) {
191192 redirects . push ( {
192193 source : '/terms' ,
193- destination : env . NEXT_PUBLIC_TERMS_URL ,
194+ destination : termsUrl ,
194195 permanent : false ,
195196 } )
196197 }
197198
198- if ( env . NEXT_PUBLIC_PRIVACY_URL ?. startsWith ( 'http' ) ) {
199+ const privacyUrl = getEnv ( 'NEXT_PUBLIC_PRIVACY_URL' )
200+ if ( privacyUrl ?. startsWith ( 'http' ) ) {
199201 redirects . push ( {
200202 source : '/privacy' ,
201- destination : env . NEXT_PUBLIC_PRIVACY_URL ,
203+ destination : privacyUrl ,
202204 permanent : false ,
203205 } )
204206 }
You can’t perform that action at this time.
0 commit comments