Network: Do not consider page parameters if not running in the browser
In preparation for SSR
This commit is contained in:
parent
d28c611806
commit
208cfa8e0d
1 changed files with 9 additions and 3 deletions
|
@ -1,8 +1,14 @@
|
||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
|
import { browser } from '$app/environment'
|
||||||
|
|
||||||
let params = new URLSearchParams("?"+window.location.hash.substr(1));
|
let authKey = undefined;
|
||||||
let authKey = params.get("authKey") || undefined;
|
let controlUrl = undefined;
|
||||||
let controlUrl = params.get("controlUrl") || undefined;
|
if(browser)
|
||||||
|
{
|
||||||
|
let params = new URLSearchParams("?"+window.location.hash.substr(1));
|
||||||
|
authKey = params.get("authKey");
|
||||||
|
controlUrl = params.get("controlUrl");
|
||||||
|
}
|
||||||
let dashboardUrl = controlUrl ? null : "https://login.tailscale.com/admin/machines";
|
let dashboardUrl = controlUrl ? null : "https://login.tailscale.com/admin/machines";
|
||||||
let resolveLogin = null;
|
let resolveLogin = null;
|
||||||
let loginPromise = new Promise((f,r) => {
|
let loginPromise = new Promise((f,r) => {
|
||||||
|
|
Loading…
Reference in a new issue