feat(desktop): intercept OAuth redirects to hosted frontend via webRequest

This commit is contained in:
CREDO23 2026-03-17 18:56:33 +02:00
parent a866e6caa1
commit d4ad5c7fe4
3 changed files with 15 additions and 19 deletions

View file

@ -60,15 +60,6 @@ const TokenHandler = ({
setRefreshToken(refreshToken);
}
// Desktop app: redirect tokens to the Electron deep link handler
const loginSource = sessionStorage.getItem("surfsense_login_source");
if (loginSource === "desktop") {
sessionStorage.removeItem("surfsense_login_source");
const deepLink = `surfsense://auth/callback?token=${token}${refreshToken ? `&refresh_token=${refreshToken}` : ""}`;
window.location.href = deepLink;
return;
}
// Check if there's a saved redirect path from before the auth flow
const savedRedirectPath = getAndClearRedirectPath();