Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 4b8538c

Browse files
author
Dominik Frantisek Bucik
committed
fix: fix session problems
1 parent 4ceacd7 commit 4b8538c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

gui/src/app/app.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,20 @@ export class AppComponent implements OnInit {
146146
this.userService.getUser().subscribe(user => {
147147
if (user !== undefined && user !== null) {
148148
AppComponent.setUser(new User(user));
149+
if (!this.currentUrl.includes('auth')) {
150+
this.router.navigate(['/auth']);
151+
}
149152
} else {
150153
this.goOnLogin();
151154
}
152155
});
153156
}
154157

155158
private goOnLogin() {
156-
this.router.navigate(['/']);
157159
AppComponent.setUser(null);
160+
this.userService.unsetUser().subscribe(_ => {
161+
this.router.navigate(['/']);
162+
});
158163
}
159164

160165
}

0 commit comments

Comments
 (0)