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

View File

@@ -35,7 +35,7 @@
};
try {
const response = await fetcher('/login', {
const response = await window.decypharrUtils.fetcher('/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'

View File

@@ -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');
}