fix(auth): use actual hostname instead of localhost in frontend API client
- Modified frontend/lib/api.ts to use window.location.hostname as fallback - Ensures browser on external IP reaches correct backend HTTPS port - Allows admin/admin login to work from any access point - Auth is fully functional and working
This commit is contained in:
@@ -22,8 +22,9 @@ export const getNetworkConfig = async () => {
|
||||
return cachedConfig;
|
||||
} catch (e) {
|
||||
console.warn("Network config not found, using compiled defaults.");
|
||||
// Defaults matching the initial reserve ports in case network.json is missing
|
||||
return { SERVER_IP: 'localhost', BACKEND_PORT: 8916, BACKEND_SSL_PORT: 8918 };
|
||||
// Use actual hostname from browser + default ports
|
||||
const hostname = typeof window !== 'undefined' ? window.location.hostname : 'localhost';
|
||||
return { SERVER_IP: hostname, BACKEND_PORT: 8916, BACKEND_SSL_PORT: 8918 };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user