fix: centralize public hostname into single PUBLIC_HOST env var
All public-facing URLs (Logto OIDC, redirect URIs, dashboard links) now derive from PUBLIC_HOST in .env instead of scattered localhost references. Resolves Docker networking ambiguity where localhost inside containers doesn't reach the host machine. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -162,7 +162,7 @@ export function Layout() {
|
||||
<Sidebar.FooterLink
|
||||
icon={<ObsIcon />}
|
||||
label="View Dashboard"
|
||||
onClick={() => window.open('http://localhost:8082', '_blank', 'noopener')}
|
||||
onClick={() => window.open(`http://${window.location.hostname}:8082`, '_blank', 'noopener')}
|
||||
/>
|
||||
|
||||
{/* User info + logout */}
|
||||
|
||||
@@ -22,7 +22,7 @@ export async function fetchConfig(): Promise<AppConfig> {
|
||||
|
||||
// Fallback to env vars (Vite dev mode)
|
||||
cached = {
|
||||
logtoEndpoint: import.meta.env.VITE_LOGTO_ENDPOINT || 'http://localhost:3001',
|
||||
logtoEndpoint: import.meta.env.VITE_LOGTO_ENDPOINT || `http://${window.location.hostname}:3001`,
|
||||
logtoClientId: import.meta.env.VITE_LOGTO_CLIENT_ID || '',
|
||||
logtoResource: import.meta.env.VITE_LOGTO_RESOURCE || '',
|
||||
scopes: [
|
||||
|
||||
Reference in New Issue
Block a user