hotfix login and registration
This commit is contained in:
@@ -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'
|
||||||
|
|||||||
@@ -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');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user