fix: redirect back to activity.bincio.org after login via bincio.org

Pass ?next=<current URL> when bouncing to bincio.org/login/ so the user
lands back on the activity page they came from instead of bincio.org/.
This commit is contained in:
Davide Scaini
2026-06-03 11:33:37 +02:00
parent ae2737fed1
commit 7e8545f8db
+2 -1
View File
@@ -104,7 +104,8 @@ try {
fetch('/api/me', { credentials: 'include' })
.then(r => {
if (r.status === 401 || r.status === 404) {
window.location.replace(authUrl ? authUrl + '/login/' : '/login/');
const next = authUrl ? '?next=' + encodeURIComponent(window.location.href) : '';
window.location.replace(authUrl ? authUrl + '/login/' + next : '/login/');
} else {
document.body.removeAttribute('data-auth-pending');
}