fix: redirection after signing in on space

This commit is contained in:
Aaryan Khandelwal 2023-09-05 16:12:17 +05:30
parent 19c65b26d6
commit 8d5ff1a628
2 changed files with 8 additions and 11 deletions

View file

@ -62,17 +62,13 @@ class UserStore implements IUserStore {
return;
}
const currentPath = window.location.pathname + window.location.search;
this.fetchCurrentUser()
.then(() => {
if (!this.currentUser) {
const currentPath = window.location.pathname;
window.location.href = `/?next_path=${currentPath}`;
} else callback();
if (!this.currentUser) window.location.href = `/?next_path=${currentPath}`;
else callback();
})
.catch(() => {
const currentPath = window.location.pathname;
window.location.href = `/?next_path=${currentPath}`;
});
.catch(() => (window.location.href = `/?next_path=${currentPath}`));
};
fetchCurrentUser = async () => {