[WEB-1691] chore: refactor finish onboarding logic to avoid multiple redirections. (#4950)
* [WEB-1691] chore: refactor finsh onboarding logic to avoid multiple redirections. * fix: infinite redirection on visiting onboarding page when the user is not authenticated. * chore: update intercepter redirect logic.
This commit is contained in:
parent
1f9f821543
commit
ff4de9ac11
6 changed files with 91 additions and 88 deletions
|
|
@ -20,7 +20,8 @@ export abstract class APIService {
|
|||
(response) => response,
|
||||
(error) => {
|
||||
if (error.response && error.response.status === 401) {
|
||||
window.location.reload();
|
||||
const currentPath = window.location.pathname;
|
||||
window.location.replace(`/${currentPath ? `?next_path=${currentPath}` : ``}`);
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue