import { Middleware } from "redux";
import { authActions, } from "./auth-action";
-import { ServiceRepository, setAuthorizationHeader, removeAuthorizationHeader } from "~/services/services";
-import { initSessions } from "~/store/auth/auth-action-session";
-import { User } from "~/models/user";
-import { RootState } from '~/store/store';
-import { progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
-import { WORKBENCH_LOADING_SCREEN } from '~/store/workbench/workbench-actions';
+import { ServiceRepository, setAuthorizationHeader, removeAuthorizationHeader } from "services/services";
+import { initSessions } from "store/auth/auth-action-session";
+import { User } from "models/user";
+import { RootState } from 'store/store';
+import { progressIndicatorActions } from "store/progress-indicator/progress-indicator-actions";
+import { WORKBENCH_LOADING_SCREEN } from 'store/workbench/workbench-actions';
export const authMiddleware = (services: ServiceRepository): Middleware => store => next => action => {
// Middleware to update external state (local storage, window
}
},
SET_CONFIG: ({ config }) => {
- document.title = `Arvados Workbench (${config.uuidPrefix})`;
+ document.title = `Arvados (${config.uuidPrefix})`;
next(action);
},
- LOGOUT: ({ deleteLinkData }) => {
+ LOGOUT: ({ deleteLinkData, preservePath }) => {
next(action);
if (deleteLinkData) {
services.linkAccountService.removeAccountToLink();
services.authService.removeSessions();
services.authService.removeUser();
removeAuthorizationHeader(services);
- services.authService.logout(token || '');
+ services.authService.logout(token || '', preservePath);
},
default: () => next(action)
});