refactor(deep-links, quick-ask, window): replace localhost references with dynamic server origin retrieval

This commit is contained in:
Anish Sarkar 2026-05-25 17:55:03 +05:30
parent a2847664c8
commit fe797e65d6
4 changed files with 16 additions and 11 deletions

View file

@ -1,7 +1,7 @@
import { app } from 'electron';
import path from 'path';
import { getMainWindow } from './window';
import { getServerPort } from './server';
import { getServerOrigin } from './server';
import { trackEvent } from './analytics';
const PROTOCOL = 'surfsense';
@ -23,7 +23,7 @@ function handleDeepLink(url: string) {
});
if (parsed.hostname === 'auth' && parsed.pathname === '/callback') {
const params = parsed.searchParams.toString();
win.loadURL(`http://localhost:${getServerPort()}/auth/callback?${params}`);
win.loadURL(`${getServerOrigin()}/auth/callback?${params}`);
}
win.show();