From 44d2446872ceeb5c9ffe769bc55b57692391f60b Mon Sep 17 00:00:00 2001 From: Sam Hadow Date: Tue, 4 Mar 2025 15:13:38 +0100 Subject: [PATCH] absolute instead of relative url fix --- src/public/register.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/public/register.js b/src/public/register.js index b7e6bef..9c49de2 100644 --- a/src/public/register.js +++ b/src/public/register.js @@ -1,9 +1,9 @@ -const currentUrl = window.location.href; + import { ab2str, exportedKeyToPem, pemToKey, genKey } from "./ecc.js"; import { add_div_register_text } from "./registertext.js"; export async function registerConfirm() { - const apiUrl = `${currentUrl}account/register`; + const apiUrl = `/account/register`; const inputFieldSharedSecret = document.getElementById("sharedsecret"); const inputFieldPublicKey = document.getElementById("publickey"); let pubkey = null; @@ -46,7 +46,7 @@ export async function registerConfirm() { } export async function loginConfirm() { - const apiUrl = `${currentUrl}account/login`; + const apiUrl = `/account/login`; const inputFieldPrivateKey = document.getElementById("privatekey"); const response = await fetch(apiUrl, { method: 'GET' }); if (!response.ok) { @@ -71,7 +71,7 @@ export async function loginConfirm() { let signatureString = ab2str(signature); let signatureBase64 = window.btoa(signatureString); - const verifyApiUrl = `${currentUrl}account/verify-challenge`; + const verifyApiUrl = `/account/verify-challenge`; const verifyResponse = await fetch(verifyApiUrl, { method: 'POST', headers: {