From 604402250e2376cdfdebaf6416ab813a9c59b756 Mon Sep 17 00:00:00 2001 From: Mukhtar Akere Date: Sat, 12 Jul 2025 00:57:48 +0100 Subject: [PATCH] hotfix login and registration --- pkg/web/templates/login.html | 2 +- pkg/web/templates/register.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/web/templates/login.html b/pkg/web/templates/login.html index cca9713..5d702c2 100644 --- a/pkg/web/templates/login.html +++ b/pkg/web/templates/login.html @@ -35,7 +35,7 @@ }; try { - const response = await fetcher('/login', { + const response = await window.decypharrUtils.fetcher('/login', { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/pkg/web/templates/register.html b/pkg/web/templates/register.html index 6de825b..04ed40b 100644 --- a/pkg/web/templates/register.html +++ b/pkg/web/templates/register.html @@ -61,10 +61,10 @@ if (!response.ok) { return response.text().then(errorText => { // Throw an error with the response text - createToast(errorText || 'Registration failed', 'error'); + window.decypharrUtils.createToast(errorText || 'Registration failed', 'error'); }); } else { - window.location.href = joinURL(window.urlBase, '/'); + window.location.href = window.decypharrUtils.joinURL(window.urlBase, '/'); } }) @@ -75,10 +75,10 @@ // Handle skip auth button skipAuthBtn.addEventListener('click', function() { - fetcher('/skip-auth', { method: 'GET' }) + window.decypharrUtils.fetcher('/skip-auth', { method: 'GET' }) .then(response => { if (response.ok) { - window.location.href = joinURL(window.urlBase, '/'); + window.location.href = window.decypharrUtils.joinURL(window.urlBase, '/'); } else { throw new Error('Failed to skip authentication'); }