ready for staging

refactor-wallet
Niko PLP 2 days ago
parent 8275d9355f
commit 2b87fa1c08
  1. 3
      common/src/routes/User.svelte
  2. 130
      common/src/routes/WalletCreate.svelte
  3. 7
      ng-app/src/App.svelte
  4. 8
      ng-app/src/api.ts
  5. 3
      ng-app/src/routes/User.svelte
  6. 18
      ng-app/src/routes/WalletCreate.svelte
  7. 1
      ng-app/src/routes/WalletLogin.svelte
  8. 22
      ng-app/src/store.ts
  9. 20
      ng-broker/src/server_ws.rs

@ -62,7 +62,6 @@
import { import {
NG_EU_BSP, NG_EU_BSP,
NG_NET_BSP,
APP_ACCOUNT_REGISTERED_SUFFIX, APP_ACCOUNT_REGISTERED_SUFFIX,
default as ng, default as ng,
} from "../api"; } from "../api";
@ -88,7 +87,6 @@
}); });
async function logout() { async function logout() {
await close_active_wallet(); await close_active_wallet();
} }
@ -385,7 +383,6 @@
</CenteredLayout> </CenteredLayout>
<style> <style>
.site-cnx-details { .site-cnx-details {
@apply mt-0 !important; @apply mt-0 !important;
} }

@ -29,12 +29,9 @@
import Logo from "../assets/nextgraph.svg?component"; import Logo from "../assets/nextgraph.svg?component";
import { LockOpen, FingerPrint, ExclamationTriangle } from "svelte-heros-v2"; import { LockOpen, FingerPrint, ExclamationTriangle } from "svelte-heros-v2";
import { import {
NG_EU_BSP,
NG_NET_BSP,
LINK_NG_BOX, LINK_NG_BOX,
LINK_SELF_HOST, LINK_SELF_HOST,
NG_EU_BSP_REGISTER, NG_EU_BSP_REGISTER,
NG_NET_BSP_REGISTER,
APP_WALLET_CREATE_SUFFIX, APP_WALLET_CREATE_SUFFIX,
default as ng, default as ng,
} from "../api"; } from "../api";
@ -149,28 +146,27 @@
function validate_pin() { function validate_pin() {
// check for same digit doesnt appear 3 times // check for same digit doesnt appear 3 times
if ((pin[0] == pin[1] && pin[0] == pin[2]) if (
|| (pin[0] == pin[1] && pin[0] == pin[3]) (pin[0] == pin[1] && pin[0] == pin[2]) ||
|| (pin[0] == pin[2] && pin[0] == pin[3]) (pin[0] == pin[1] && pin[0] == pin[3]) ||
|| (pin[1] == pin[2] && pin[1] == pin[3])) (pin[0] == pin[2] && pin[0] == pin[3]) ||
{ (pin[1] == pin[2] && pin[1] == pin[3])
) {
return false; return false;
} }
// check for ascending series // check for ascending series
if (pin[1] == pin[0] + 1 if (pin[1] == pin[0] + 1 && pin[2] == pin[1] + 1 && pin[3] == pin[2] + 1) {
&& pin[2] == pin[1] + 1
&& pin[3] == pin[2] + 1)
{
return false; return false;
} }
// check for descending series // check for descending series
if (pin[3] >= 3 if (
&& pin[2] == pin[3] - 1 pin[3] >= 3 &&
&& pin[1] == pin[2] - 1 pin[2] == pin[3] - 1 &&
&& pin[0] == pin[1] - 1) pin[1] == pin[2] - 1 &&
{ pin[0] == pin[1] - 1
) {
return false; return false;
} }
return true; return true;
@ -199,10 +195,8 @@
: "http://localhost:3030/api/v1/"; : "http://localhost:3030/api/v1/";
async function bootstrap() { async function bootstrap() {
//console.log(await ng.client_info()); //console.log(await ng.client_info());
if (!tauri_platform || tauri_platform == "android") { if (!tauri_platform || tauri_platform == "android") {
if (!tauri_platform) { if (!tauri_platform) {
try { try {
sessionStorage.getItem("test"); sessionStorage.getItem("test");
@ -315,7 +309,7 @@
core_registration, core_registration,
additional_bootstrap, additional_bootstrap,
device_name, device_name,
pdf: options.pdf pdf: options.pdf,
}; };
//console.log("do wallet with params", params); //console.log("do wallet with params", params);
try { try {
@ -376,8 +370,7 @@
ready = false; ready = false;
let unsub_register = () => { let unsub_register = () => {};
};
onDestroy(async () => { onDestroy(async () => {
if (unsub_register) unsub_register(); if (unsub_register) unsub_register();
@ -444,15 +437,12 @@
} }
} }
); );
} }
}; };
const selectEU = async (event) => { const selectEU = async (event) => {
await select_bsp(NG_EU_BSP_REGISTER, "nextgraph.eu"); await select_bsp(NG_EU_BSP_REGISTER, "nextgraph.eu");
}; };
const selectNET = async (event) => {
await select_bsp(NG_NET_BSP_REGISTER, "nextgraph.net");
};
const enterINVITE = (event) => {}; const enterINVITE = (event) => {};
const enterQRcode = (event) => {}; const enterQRcode = (event) => {};
@ -701,12 +691,24 @@
<span>{@html $t("pages.wallet_create.wallet_about.2")}</span> <span>{@html $t("pages.wallet_create.wallet_about.2")}</span>
</li> </li>
<li class="flex space-x-3"> <li class="flex space-x-3">
<LockOpen class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400"></LockOpen> <LockOpen
<span>{@html $t("pages.wallet_create.wallet_about.password")}</span> class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400"
></LockOpen>
<span
>{@html $t(
"pages.wallet_create.wallet_about.password"
)}</span
>
</li> </li>
<li class="flex space-x-3"> <li class="flex space-x-3">
<FingerPrint class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400"></FingerPrint> <FingerPrint
<span>{@html $t("pages.wallet_create.wallet_about.mnemonic")}</span> class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400"
></FingerPrint>
<span
>{@html $t(
"pages.wallet_create.wallet_about.mnemonic"
)}</span
>
</li> </li>
<li class="flex space-x-3"> <li class="flex space-x-3">
<!-- Icon --> <!-- Icon -->
@ -725,7 +727,9 @@
d="M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 01-.657.643 48.39 48.39 0 01-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 01-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 00-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 01-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 00.657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 01-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 005.427-.63 48.05 48.05 0 00.582-4.717.532.532 0 00-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 00.658-.663 48.422 48.422 0 00-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 01-.61-.58v0z" d="M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 01-.657.643 48.39 48.39 0 01-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 01-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 00-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 01-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 00.657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 01-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 005.427-.63 48.05 48.05 0 00.582-4.717.532.532 0 00-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 00.658-.663 48.422 48.422 0 00-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 01-.61-.58v0z"
/> />
</svg> </svg>
<span>{@html $t("pages.wallet_create.wallet_about.pazzle")}</span> <span
>{@html $t("pages.wallet_create.wallet_about.pazzle")}</span
>
</li> </li>
<li class="flex space-x-3"> <li class="flex space-x-3">
<!-- Icon --> <!-- Icon -->
@ -824,7 +828,9 @@
<span>{@html $t("pages.wallet_create.wallet_about.8")}</span> <span>{@html $t("pages.wallet_create.wallet_about.8")}</span>
</li> </li>
<li class="flex space-x-3"> <li class="flex space-x-3">
<ExclamationTriangle class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400"></ExclamationTriangle> <ExclamationTriangle
class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400"
></ExclamationTriangle>
<span>{@html $t("pages.wallet_create.wallet_about.9")}</span> <span>{@html $t("pages.wallet_create.wallet_about.9")}</span>
</li> </li>
</ul> </ul>
@ -866,9 +872,7 @@
<h2 class="pb-5 text-xl"> <h2 class="pb-5 text-xl">
{$t("pages.wallet_create.broker_about.title")}<span {$t("pages.wallet_create.broker_about.title")}<span
class="text-sm" class="text-sm"
>&nbsp{@html $t( >&nbsp{@html $t("pages.wallet_create.please_read")}</span
"pages.wallet_create.please_read"
)}</span
> >
</h2> </h2>
<ul <ul
@ -1018,7 +1022,11 @@
/> />
</svg> </svg>
{$t("pages.wallet_create.register_with_broker", { {$t("pages.wallet_create.register_with_broker", {
values: { broker: pre_invitation.V0.name || $t("pages.wallet_create.this_broker") }, values: {
broker:
pre_invitation.V0.name ||
$t("pages.wallet_create.this_broker"),
},
})} })}
</button> </button>
</div> </div>
@ -1141,10 +1149,23 @@
</button> </button>
</div> --> </div> -->
{#if !tauri_platform} {#if !tauri_platform}
<div
<div class="flex space-x-3 px-4 pt-3 lg:px-8 lg:pt-10 max-w-xl text-left text-gray-500 dark:text-gray-400"> class="flex space-x-3 px-4 pt-3 lg:px-8 lg:pt-10 max-w-xl text-left text-gray-500 dark:text-gray-400"
<svg class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> >
<path stroke-linecap="round" stroke-linejoin="round" d="M21 11.25v8.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 1 0 9.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1 1 14.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"></path> <svg
class="flex-shrink-0 w-5 h-5 text-green-500 dark:text-green-400"
fill="none"
stroke-width="1.5"
stroke="currentColor"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M21 11.25v8.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 1 0 9.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1 1 14.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"
></path>
</svg> </svg>
<span> <span>
@ -1152,7 +1173,6 @@
</span> </span>
</div> </div>
<div class="row mt-5"> <div class="row mt-5">
<a href="/install" use:link> <a href="/install" use:link>
<button <button
tabindex="-1" tabindex="-1"
@ -1185,7 +1205,12 @@
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
> >
<defs /> <defs />
<g id="Page-1" stroke-width="1" fill="none" fill-rule="evenodd"> <g
id="Page-1"
stroke-width="1"
fill="none"
fill-rule="evenodd"
>
<g <g
id="Laptop" id="Laptop"
transform="translate(1.000000, 1.000000)" transform="translate(1.000000, 1.000000)"
@ -1500,9 +1525,7 @@
{/if} {/if}
{#if security_phrase_error} {#if security_phrase_error}
<Alert color="red" class="mt-5"> <Alert color="red" class="mt-5">
{@html $t( {@html $t("pages.wallet_create.security_phrase_invalid")}
"pages.wallet_create.security_phrase_invalid"
)}
</Alert> </Alert>
{/if} {/if}
<Dropzone <Dropzone
@ -1585,7 +1608,11 @@
{#if !tauri_platform}{@html $t( {#if !tauri_platform}{@html $t(
"pages.login.trust_device_allow_cookies" "pages.login.trust_device_allow_cookies"
)}{/if}<br /><br /> )}{/if}<br /><br />
<Toggle bind:checked={options.trusted} on:change={()=> {if (!options.trusted) options.pdf=false;}} <Toggle
bind:checked={options.trusted}
on:change={() => {
if (!options.trusted) options.pdf = false;
}}
>{@html $t( >{@html $t(
"pages.wallet_create.save_wallet_options.trust_toggle" "pages.wallet_create.save_wallet_options.trust_toggle"
)}</Toggle )}</Toggle
@ -1786,14 +1813,9 @@
})} })}
{/if} {/if}
{#if pdf_link} {#if pdf_link}
{@html $t( {@html $t("pages.wallet_create.download_pdf_description")}<br
"pages.wallet_create.download_pdf_description" />
)}<br /> <a href={pdf_link} target="_blank" download={pdf_name}>
<a
href={pdf_link}
target="_blank"
download={pdf_name}
>
<button <button
tabindex="-1" tabindex="-1"
class:animate-bounce={animatePdf} class:animate-bounce={animatePdf}

@ -21,7 +21,6 @@
close_active_session, close_active_session,
disconnections_subscribe, disconnections_subscribe,
select_default_lang, select_default_lang,
NG_BOOTSTRAP_IFRAME_ORIGIN
} from "./store"; } from "./store";
import Home from "./routes/Home.svelte"; import Home from "./routes/Home.svelte";
@ -77,11 +76,10 @@
// }; // };
onMount(async () => { onMount(async () => {
//console.log("hide splash", window.supported); //console.log("hide splash", window.supported);
if (window.supported) { if (window.supported) {
window.document.getElementById("splash").className="noshow"; window.document.getElementById("splash").className = "noshow";
window.document.getElementById("app").className=""; window.document.getElementById("app").className = "";
} }
//window.document.getElementById("splash").className="splash-loaded"; //window.document.getElementById("splash").className="splash-loaded";
@ -283,7 +281,6 @@
} }
}); });
} }
}); });
onDestroy(() => { onDestroy(() => {

@ -341,10 +341,10 @@ export const NG_EU_BSP_REGISTER = import.meta.env.PROD
? "https://account.nextgraph.eu/#/create" ? "https://account.nextgraph.eu/#/create"
: "http://account-dev.nextgraph.eu:5173/#/create"; : "http://account-dev.nextgraph.eu:5173/#/create";
export const NG_NET_BSP = "https://nextgraph.net"; export const NG_ONE_BSP = "https://nextgraph.one";
export const NG_NET_BSP_REGISTER = import.meta.env.PROD export const NG_ONE_BSP_REGISTER = import.meta.env.PROD
? "https://account.nextgraph.net/#/create" ? "https://account.nextgraph.one/#/create"
: "http://account-dev.nextgraph.net:5173/#/create"; : "http://account-dev.nextgraph.one:5173/#/create";
export const APP_ACCOUNT_REGISTERED_SUFFIX = "/#/user/registered"; export const APP_ACCOUNT_REGISTERED_SUFFIX = "/#/user/registered";
export const APP_WALLET_CREATE_SUFFIX = "/#/wallet/create"; export const APP_WALLET_CREATE_SUFFIX = "/#/wallet/create";

@ -62,7 +62,6 @@
import { import {
NG_EU_BSP, NG_EU_BSP,
NG_NET_BSP,
APP_ACCOUNT_REGISTERED_SUFFIX, APP_ACCOUNT_REGISTERED_SUFFIX,
default as ng, default as ng,
} from "../api"; } from "../api";
@ -88,7 +87,6 @@
}); });
async function logout() { async function logout() {
await close_active_wallet(); await close_active_wallet();
} }
@ -385,7 +383,6 @@
</CenteredLayout> </CenteredLayout>
<style> <style>
.site-cnx-details { .site-cnx-details {
@apply mt-0 !important; @apply mt-0 !important;
} }

@ -30,11 +30,11 @@
import { LockOpen, FingerPrint, ExclamationTriangle } from "svelte-heros-v2"; import { LockOpen, FingerPrint, ExclamationTriangle } from "svelte-heros-v2";
import { import {
NG_EU_BSP, NG_EU_BSP,
NG_NET_BSP, NG_ONE_BSP,
LINK_NG_BOX, LINK_NG_BOX,
LINK_SELF_HOST, LINK_SELF_HOST,
NG_EU_BSP_REGISTER, NG_EU_BSP_REGISTER,
NG_NET_BSP_REGISTER, NG_ONE_BSP_REGISTER,
APP_WALLET_CREATE_SUFFIX, APP_WALLET_CREATE_SUFFIX,
default as ng, default as ng,
} from "../api"; } from "../api";
@ -45,12 +45,7 @@
} from "../wallet_emojis"; } from "../wallet_emojis";
import { onMount, onDestroy, tick } from "svelte"; import { onMount, onDestroy, tick } from "svelte";
import { import { wallets, has_wallets, display_error } from "../store";
wallets,
has_wallets,
display_error,
register_bootstrap,
} from "../store";
import Spinner from "../lib/components/Spinner.svelte"; import Spinner from "../lib/components/Spinner.svelte";
const param = new URLSearchParams($querystring); const param = new URLSearchParams($querystring);
@ -210,11 +205,12 @@
? "api/v1/" ? "api/v1/"
: "http://localhost:3030/api/v1/"; : "http://localhost:3030/api/v1/";
const redirect_server = import.meta.env.NG_REDIR_SERVER || "nextgraph.net";
const bootstrap_redirect = import.meta.env.DEV const bootstrap_redirect = import.meta.env.DEV
? "http://localhost:14403/#/?b=" ? "http://localhost:14403/#/?b="
: import.meta.env.NG_DEV : import.meta.env.NG_DEV
? "http://localhost:1421/bootstrap.html#/?b=" ? "http://localhost:1421/bootstrap.html#/?b="
: "https://nextgraph.net/bootstrap/#/?b="; : `https://${redirect_server}/bootstrap/#/?b=`;
// to test ngnet // to test ngnet
//const bootstrap_redirect = "http://127.0.0.1:3033/bootstrap/#/?b="; //const bootstrap_redirect = "http://127.0.0.1:3033/bootstrap/#/?b=";
@ -532,8 +528,8 @@
const selectEU = async (event) => { const selectEU = async (event) => {
await select_bsp(NG_EU_BSP_REGISTER, "nextgraph.eu"); await select_bsp(NG_EU_BSP_REGISTER, "nextgraph.eu");
}; };
const selectNET = async (event) => { const selectONE = async (event) => {
await select_bsp(NG_NET_BSP_REGISTER, "nextgraph.net"); await select_bsp(NG_NET_BSP_REGISTER, "nextgraph.one");
}; };
const enterINVITE = (event) => {}; const enterINVITE = (event) => {};
const enterQRcode = (event) => {}; const enterQRcode = (event) => {};

@ -36,7 +36,6 @@
wallet_from_import, wallet_from_import,
redirect_after_login, redirect_after_login,
redirect_if_wallet_is, redirect_if_wallet_is,
register_bootstrap,
} from "../store"; } from "../store";
import { import {
CheckBadge, CheckBadge,

@ -25,28 +25,6 @@ import { RemoteReadableStream } from 'remote-web-streams';
let all_branches = {}; let all_branches = {};
let retry_branches = {}; let retry_branches = {};
export const register_bootstrap = async function (bootstrap_iframe_msgs) {
//console.log("register_bootstrap", bootstrap_iframe_msgs)
let iframe = (<HTMLIFrameElement>window.document.getElementById('nextgraph-bootstrap-iframe'))?.contentWindow;
if (!iframe) return false;
const { readable, writablePort } = new RemoteReadableStream();
//console.log("adding", bootstrap_iframe_msgs, NG_BOOTSTRAP_IFRAME_ORIGIN)
iframe.postMessage({ method: "add", port:writablePort, msgs: bootstrap_iframe_msgs}, NG_BOOTSTRAP_IFRAME_ORIGIN, [writablePort]);
const reader = readable.getReader();
let ret = await reader.read();
await reader.read(); // the close
if (ret.value.status=="ok") return true;
return ret.value.error
}
export const NG_BOOTSTRAP_IFRAME_SRC = import.meta.env.TAURI_PLATFORM ? false : import.meta.env.PROD
? "https://nextgraph.net/bootstrap/#/?o=" + encodeURIComponent(location.origin)
: "/bootstrap.html#/?o=" + encodeURIComponent(location.origin);
export const NG_BOOTSTRAP_IFRAME_ORIGIN = import.meta.env.TAURI_PLATFORM ? "" : import.meta.env.PROD
? "https://nextgraph.net"
: location.origin;
// Make sure that a file named `locales/<lang>.json` exists when adding it here. // Make sure that a file named `locales/<lang>.json` exists when adding it here.
export const available_languages = { export const available_languages = {
en: "English", en: "English",

@ -301,11 +301,11 @@ fn upgrade_ws_or_serve_app(
.status(StatusCode::NOT_MODIFIED) .status(StatusCode::NOT_MODIFIED)
.header("Cache-Control", "max-age=31536000, must-revalidate") .header("Cache-Control", "max-age=31536000, must-revalidate")
.header("ETag", sha) .header("ETag", sha)
.header( // .header(
"Content-Security-Policy", // "Content-Security-Policy",
format!("frame-ancestors 'self' https://nextgraph.net {webapp_origin};"), // format!("frame-ancestors 'self' https://nextgraph.net {webapp_origin};"),
) // )
.header("X-Frame-Options", format!("ALLOW-FROM {webapp_origin}")) // .header("X-Frame-Options", format!("ALLOW-FROM {webapp_origin}"))
.body(None) .body(None)
.unwrap(); .unwrap();
return Err(res); return Err(res);
@ -313,11 +313,11 @@ fn upgrade_ws_or_serve_app(
let file = AppAuth::get("index.gzip").unwrap(); let file = AppAuth::get("index.gzip").unwrap();
let res = Response::builder() let res = Response::builder()
.status(StatusCode::OK) .status(StatusCode::OK)
.header( // .header(
"Content-Security-Policy", // "Content-Security-Policy",
format!("frame-ancestors 'self' https://nextgraph.net {webapp_origin};"), // format!("frame-ancestors 'self' https://nextgraph.net {webapp_origin};"),
) // )
.header("X-Frame-Options", format!("ALLOW-FROM {webapp_origin}")) // .header("X-Frame-Options", format!("ALLOW-FROM {webapp_origin}"))
.header("Content-Type", "text/html") .header("Content-Type", "text/html")
.header("Cache-Control", "max-age=31536000, must-revalidate") .header("Cache-Control", "max-age=31536000, must-revalidate")
.header("Content-Encoding", "gzip") .header("Content-Encoding", "gzip")

Loading…
Cancel
Save