diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 258848ce83..168c828c79 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -60,6 +60,7 @@ export function getDSOPath(dso: DSpaceObject): string { imports: [ RouterModule.forRoot([ { path: '', redirectTo: '/home', pathMatch: 'full' }, + { path: 'reload/:rnd', redirectTo: '/home', pathMatch: 'full' }, { path: 'home', loadChildren: './+home-page/home-page.module#HomePageModule', data: { showBreadcrumbs: false } }, { path: 'community-list', loadChildren: './community-list-page/community-list-page.module#CommunityListPageModule' }, { path: 'id', loadChildren: './+lookup-by-id/lookup-by-id.module#LookupIdModule' }, diff --git a/src/app/app.metareducers.ts b/src/app/app.metareducers.ts index 131d240b79..7675840969 100644 --- a/src/app/app.metareducers.ts +++ b/src/app/app.metareducers.ts @@ -1,4 +1,5 @@ import { StoreActionTypes } from './store.actions'; +import { AuthActionTypes } from './core/auth/auth.actions'; // fallback ngrx debugger let actionCounter = 0; @@ -28,10 +29,26 @@ export function universalMetaReducer(reducer) { } } +// const clearStateActions = [ +// AuthActionTypes.LOG_OUT_SUCCESS, +// ]; +// +// export function clearStateMetaReducer(reducer) { +// return function (state, action) { +// +// if (clearStateActions.includes(action.type)) { +// state = {}; +// } +// +// return reducer(state, action); +// }; +// } + export const debugMetaReducers = [ debugMetaReducer ]; export const appMetaReducers = [ - universalMetaReducer + universalMetaReducer, + // clearStateMetaReducer ]; diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index d5f76c106b..588d9e2675 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -460,8 +460,9 @@ export class AuthService { * Refresh route navigated */ public refreshAfterLogout() { - // Hard redirect to home page, so that all state is definitely lost - this._window.nativeWindow.location.href = '/home'; + // Hard redirect to the reload page with a unique number behind it + // so that all state is definitely lost + this._window.nativeWindow.location.href = `/reload/${new Date().getTime()}`; } /**