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:
@@ -104,7 +104,8 @@ try {
|
|||||||
fetch('/api/me', { credentials: 'include' })
|
fetch('/api/me', { credentials: 'include' })
|
||||||
.then(r => {
|
.then(r => {
|
||||||
if (r.status === 401 || r.status === 404) {
|
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 {
|
} else {
|
||||||
document.body.removeAttribute('data-auth-pending');
|
document.body.removeAttribute('data-auth-pending');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user