fix: logout redirige vers / (page login) au lieu de reload
This commit is contained in:
@@ -639,8 +639,8 @@ function initConfigModal() {
|
|||||||
logoutBtn.addEventListener("click", function() {
|
logoutBtn.addEventListener("click", function() {
|
||||||
if (confirm("Voulez-vous vraiment vous deconnecter ?")) {
|
if (confirm("Voulez-vous vraiment vous deconnecter ?")) {
|
||||||
fetch("/api/auth/logout", { method: "POST" })
|
fetch("/api/auth/logout", { method: "POST" })
|
||||||
.then(function() { window.location.reload(); })
|
.then(function() { window.location.href = "/"; })
|
||||||
.catch(function() { window.location.reload(); });
|
.catch(function() { window.location.href = "/"; });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1571,8 +1571,8 @@ function initProfile() {
|
|||||||
logoutBtn.addEventListener('click', function() {
|
logoutBtn.addEventListener('click', function() {
|
||||||
if (confirm('Voulez-vous vraiment vous deconnecter ?')) {
|
if (confirm('Voulez-vous vraiment vous deconnecter ?')) {
|
||||||
fetch('/api/auth/logout', { method: 'POST' })
|
fetch('/api/auth/logout', { method: 'POST' })
|
||||||
.then(function() { window.location.reload(); })
|
.then(function() { window.location.href = '/'; })
|
||||||
.catch(function() { window.location.reload(); });
|
.catch(function() { window.location.href = '/'; });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user