feat(network): integrate NetBird clients, profiles and private backups
This commit is contained in:
@@ -43,3 +43,10 @@ export async function loginFromLaunch(): Promise<void> {
|
||||
if (location.hash) history.replaceState(null, "", location.pathname);
|
||||
if (token) await request("/api/session", "POST", { token });
|
||||
}
|
||||
|
||||
export function openNetworkLogin(url:string):void {
|
||||
const parsed=new URL(url);if(parsed.protocol!=="https:"||!parsed.pathname.startsWith("/oauth2/")||parsed.username||parsed.password)return;
|
||||
const host=window as Window & {webkit?:{messageHandlers?:{node?:{postMessage:(message:string)=>void}}}};
|
||||
if(host.webkit?.messageHandlers?.node)host.webkit.messageHandlers.node.postMessage(JSON.stringify({action:"netbird-login",url}));
|
||||
else window.open(url,"_blank","noopener,noreferrer");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user