Skip to content

Commit b35044f

Browse files
committed
Improve UX: Forbidden requests should not redirect to login page (temporalio#2270)
1 parent 60340c2 commit b35044f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/utilities/handle-error.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ export const handleError = (
3838
}
3939

4040
if (isForbidden(error) && isBrowser) {
41-
window.location.assign(routeForLoginPage(error?.message));
41+
toasts.push({
42+
variant: 'error',
43+
message: 'Forbidden!',
44+
});
45+
return;
4246
}
4347

4448
if (isNetworkError(error)) {
@@ -65,7 +69,6 @@ export const handleUnauthorizedOrForbiddenError = (
6569
}
6670

6771
if (isForbidden(error) && isBrowser) {
68-
window.location.assign(routeForLoginPage(msg));
6972
return;
7073
}
7174
};

0 commit comments

Comments
 (0)