fixed issue with refresh page when user is already authenticated

This commit is contained in:
Giuseppe Digilio
2019-12-19 19:01:22 +01:00
parent 62b555beee
commit 83fabb007a

View File

@@ -60,7 +60,8 @@ export class AuthService {
// and is not the login route, clear redirect url and messages
const routeUrl$ = this.store.pipe(
select(routerStateSelector),
filter((routerState: RouterReducerState) => isNotUndefined(routerState) && isNotUndefined(routerState.state)),
filter((routerState: RouterReducerState) => isNotUndefined(routerState)
&& isNotUndefined(routerState.state) && isNotEmpty(routerState.state.url)),
filter((routerState: RouterReducerState) => !this.isLoginRoute(routerState.state.url)),
map((routerState: RouterReducerState) => routerState.state.url)
);