hotfix login and registration

This commit is contained in:
Mukhtar Akere
2025-07-12 00:57:48 +01:00
parent 74615a80ff
commit 604402250e
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -35,7 +35,7 @@
}; };
try { try {
const response = await fetcher('/login', { const response = await window.decypharrUtils.fetcher('/login', {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
+4 -4
View File
@@ -61,10 +61,10 @@
if (!response.ok) { if (!response.ok) {
return response.text().then(errorText => { return response.text().then(errorText => {
// Throw an error with the response text // Throw an error with the response text
createToast(errorText || 'Registration failed', 'error'); window.decypharrUtils.createToast(errorText || 'Registration failed', 'error');
}); });
} else { } else {
window.location.href = joinURL(window.urlBase, '/'); window.location.href = window.decypharrUtils.joinURL(window.urlBase, '/');
} }
}) })
@@ -75,10 +75,10 @@
// Handle skip auth button // Handle skip auth button
skipAuthBtn.addEventListener('click', function() { skipAuthBtn.addEventListener('click', function() {
fetcher('/skip-auth', { method: 'GET' }) window.decypharrUtils.fetcher('/skip-auth', { method: 'GET' })
.then(response => { .then(response => {
if (response.ok) { if (response.ok) {
window.location.href = joinURL(window.urlBase, '/'); window.location.href = window.decypharrUtils.joinURL(window.urlBase, '/');
} else { } else {
throw new Error('Failed to skip authentication'); throw new Error('Failed to skip authentication');
} }