mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-02 22:01:05 +02:00
refactor(ipc): remove showDashboardAfterAuth function and its invocation after OAuth token retrieval
This commit is contained in:
parent
2e33ba7723
commit
96b64166b1
1 changed files with 0 additions and 12 deletions
|
|
@ -54,7 +54,6 @@ import {
|
||||||
import { installDownloadedUpdate } from '../modules/auto-updater';
|
import { installDownloadedUpdate } from '../modules/auto-updater';
|
||||||
import { secretStore } from '../modules/secret-store';
|
import { secretStore } from '../modules/secret-store';
|
||||||
import { startGoogleOAuth } from '../modules/oauth';
|
import { startGoogleOAuth } from '../modules/oauth';
|
||||||
import { createMainWindow, getMainWindow } from '../modules/window';
|
|
||||||
|
|
||||||
const REFRESH_TOKEN_KEY = 'surfsense_refresh_token';
|
const REFRESH_TOKEN_KEY = 'surfsense_refresh_token';
|
||||||
let accessToken: string | null = null;
|
let accessToken: string | null = null;
|
||||||
|
|
@ -86,16 +85,6 @@ async function storeTokens(tokens: { bearer: string; refresh?: string | null }):
|
||||||
broadcastAuthChanged();
|
broadcastAuthChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDashboardAfterAuth(): void {
|
|
||||||
const win = getMainWindow();
|
|
||||||
if (!win || win.isDestroyed()) {
|
|
||||||
createMainWindow('/dashboard');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
win.show();
|
|
||||||
win.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function refreshAccessToken(): Promise<string | null> {
|
async function refreshAccessToken(): Promise<string | null> {
|
||||||
if (refreshInFlight) return refreshInFlight;
|
if (refreshInFlight) return refreshInFlight;
|
||||||
|
|
||||||
|
|
@ -277,7 +266,6 @@ export function registerIpcHandlers(): void {
|
||||||
}
|
}
|
||||||
const tokens = await startGoogleOAuth(backendUrl);
|
const tokens = await startGoogleOAuth(backendUrl);
|
||||||
await storeTokens({ bearer: tokens.access_token, refresh: tokens.refresh_token });
|
await storeTokens({ bearer: tokens.access_token, refresh: tokens.refresh_token });
|
||||||
showDashboardAfterAuth();
|
|
||||||
return { ok: true };
|
return { ok: true };
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue