Skip to content
Snippets Groups Projects
Commit b8e249ba authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Fix login if user already logged in as creator

parent 9676c529
Branches
Tags
1 merge request!145Resolve "Several Fixes"
Pipeline #23937 passed with stages
in 3 minutes and 43 seconds
...@@ -63,13 +63,12 @@ export class RoomJoinComponent implements OnInit { ...@@ -63,13 +63,12 @@ export class RoomJoinComponent implements OnInit {
}); });
} else { } else {
if (!this.user) { if (!this.user) {
this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(loggedIn => { this.guestLogin();
if (loggedIn === 'true') {
this.addAndNavigate();
}
});
} else { } else {
this.addAndNavigate(); if (this.user.role === UserRole.CREATOR) {
this.authenticationService.logout();
this.guestLogin();
}
} }
} }
}); });
...@@ -82,6 +81,14 @@ export class RoomJoinComponent implements OnInit { ...@@ -82,6 +81,14 @@ export class RoomJoinComponent implements OnInit {
} }
} }
guestLogin() {
this.authenticationService.guestLogin(UserRole.PARTICIPANT).subscribe(loggedIn => {
if (loggedIn === 'true') {
this.addAndNavigate();
}
});
}
addAndNavigate() { addAndNavigate() {
this.roomService.addToHistory(this.room.id); this.roomService.addToHistory(this.room.id);
this.router.navigate([`/participant/room/${this.room.shortId}`]); this.router.navigate([`/participant/room/${this.room.shortId}`]);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment