fix login issue in production
Build & Push / Pipeline Tests (push) Successful in 1m53s
Test / Type Check (all packages) (push) Successful in 55s
Build & Push / Build & Push Docker Image (push) Successful in 4m32s
Test / API Unit Tests (push) Successful in 1m17s
Test / Homepage Unit Tests (push) Successful in 50s
Test / Carplace Unit Tests (push) Successful in 43s
Test / Admin Unit Tests (push) Successful in 44s
Test / Dashboard Unit Tests (push) Successful in 45s
Test / API Integration Tests (push) Successful in 1m12s
Build & Push / Pipeline Tests (push) Successful in 1m53s
Test / Type Check (all packages) (push) Successful in 55s
Build & Push / Build & Push Docker Image (push) Successful in 4m32s
Test / API Unit Tests (push) Successful in 1m17s
Test / Homepage Unit Tests (push) Successful in 50s
Test / Carplace Unit Tests (push) Successful in 43s
Test / Admin Unit Tests (push) Successful in 44s
Test / Dashboard Unit Tests (push) Successful in 45s
Test / API Integration Tests (push) Successful in 1m12s
This commit is contained in:
@@ -3,10 +3,18 @@ export function normalizeApiBase(value: string): string {
|
||||
return /\/api\/v1$/.test(base) ? base : `${base}/api/v1`
|
||||
}
|
||||
|
||||
export const API_BASE = normalizeApiBase(
|
||||
typeof window === 'undefined'
|
||||
? (process.env.API_INTERNAL_URL || 'http://localhost:4000/api/v1')
|
||||
: (process.env.NEXT_PUBLIC_API_URL || '/api/v1'),
|
||||
)
|
||||
function resolveApiBase(): string {
|
||||
if (typeof window === 'undefined') {
|
||||
return normalizeApiBase(process.env.API_INTERNAL_URL || 'http://localhost:4000/api/v1')
|
||||
}
|
||||
|
||||
if (process.env.NEXT_PUBLIC_HOMEPAGE_DIRECT_API === 'true' && process.env.NEXT_PUBLIC_API_URL) {
|
||||
return normalizeApiBase(process.env.NEXT_PUBLIC_API_URL)
|
||||
}
|
||||
|
||||
return '/api/v1'
|
||||
}
|
||||
|
||||
export const API_BASE = resolveApiBase()
|
||||
|
||||
export const EMPLOYEE_PROFILE_KEY = 'employee_profile'
|
||||
|
||||
Reference in New Issue
Block a user