Skip to content

Commit bd00b5a

Browse files
committed
chore(auth): redirect to /login if not authenticated
1 parent 477b1ca commit bd00b5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/LoggedInOutlet.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class LoggedInRouterOutlet extends RouterOutlet {
2323
activate(instruction: ComponentInstruction) {
2424
var url = this.parentRouter.lastNavigationAttempt;
2525
if (!this.publicRoutes[url] && !localStorage.getItem('jwt')) {
26-
// todo: redirect to Login
27-
//instruction.component = Login;
26+
// todo: redirect to Login, may be there a better way?
27+
this.parentRouter.navigateByUrl('/login');
2828
}
2929
return super.activate(instruction);
3030
}

0 commit comments

Comments
 (0)