Fix issue on login where user info would not be displayed properly
All checks were successful
Jenkins Production Deployment
All checks were successful
Jenkins Production Deployment
This commit is contained in:
parent
9ed6f9968e
commit
39ffa5e52c
|
@ -137,14 +137,21 @@ export class AdminComponent implements OnInit {
|
||||||
|
|
||||||
login(): void {
|
login(): void {
|
||||||
this.api.login(this.email, this.password).subscribe((session: Session): void => {
|
this.api.login(this.email, this.password).subscribe((session: Session): void => {
|
||||||
console.log(session);
|
|
||||||
if(session.sessionId != null && session.sessionId !== -1) {
|
if(session.sessionId != null && session.sessionId !== -1) {
|
||||||
UtilsService.saveSessionInfoToLocalStorage(session.sessionId, session.sessionKey);
|
UtilsService.saveSessionInfoToLocalStorage(session.sessionId, session.sessionKey);
|
||||||
|
|
||||||
|
// Get user info
|
||||||
|
this.api.checkSession(UtilsService.getSessionInfoFromLocalStorage()).subscribe((user: User) => {
|
||||||
|
if(user.userId != null && user.userId !== -1) {
|
||||||
this.isLoggedIn = true;
|
this.isLoggedIn = true;
|
||||||
|
this.name = user.fullName;
|
||||||
|
this.isActive = user.isActive;
|
||||||
this.getEvents();
|
this.getEvents();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
register(): void {
|
register(): void {
|
||||||
this.api.register(this.registerEmail, this.name, this.registerPassword).subscribe((session: Session): void => {
|
this.api.register(this.registerEmail, this.name, this.registerPassword).subscribe((session: Session): void => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user