Fix issue on login where user info would not be displayed properly
All checks were successful
Jenkins Production Deployment

This commit is contained in:
Patrick Müller 2023-05-14 21:17:56 +02:00
parent 9ed6f9968e
commit 39ffa5e52c
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE

View File

@ -137,11 +137,18 @@ export class AdminComponent implements OnInit {
login(): void {
this.api.login(this.email, this.password).subscribe((session: Session): void => {
console.log(session);
if(session.sessionId != null && session.sessionId !== -1) {
UtilsService.saveSessionInfoToLocalStorage(session.sessionId, session.sessionKey);
this.isLoggedIn = true;
this.getEvents();
// Get user info
this.api.checkSession(UtilsService.getSessionInfoFromLocalStorage()).subscribe((user: User) => {
if(user.userId != null && user.userId !== -1) {
this.isLoggedIn = true;
this.name = user.fullName;
this.isActive = user.isActive;
this.getEvents();
}
});
}
});
}