19715: Preserve current url when api returns auth error
authorStephen Smith <stephen@curii.com>
Thu, 19 Jan 2023 19:46:45 +0000 (14:46 -0500)
committerStephen Smith <stephen@curii.com>
Thu, 19 Jan 2023 19:46:45 +0000 (14:46 -0500)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

src/index.tsx

index c214228258fd7945a44438346718f4937180f334..244d1387307778de1f0c4ccd01412bdc85797ccd 100644 (file)
@@ -132,7 +132,8 @@ fetchConfig()
                     if (error.status === 404) {
                         store.dispatch(openNotFoundDialog());
                     } else if (error.status === 401 && error.errors[0].indexOf("Not logged in") > -1) {
-                        store.dispatch(logout());
+                        // Catch auth errors when navigating and redirect to login preserving url location
+                        store.dispatch(logout(false, true));
                     } else {
                         store.dispatch(snackbarActions.OPEN_SNACKBAR({
                             message: `${error.errors