Fix bug with redirect to login caused by fixed of role verification

This commit is contained in:
Konstantinos Triantafyllou 2022-10-25 15:31:59 +03:00
parent ac58161c93
commit 56a8a035cc
1 changed files with 16 additions and 16 deletions

View File

@ -104,12 +104,12 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
ngAfterViewInit() {
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
if (this.user) {
if (this.paramsSubscription instanceof Subscription) {
this.paramsSubscription.unsubscribe();
}
this.paramsSubscription = this.route.queryParams.subscribe(params => {
if (params && params['verify']) {
if (this.user) {
this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {
this.verification = verification;
if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) {
@ -126,8 +126,6 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
}, error => {
this.openErrorModal();
}));
}
});
} else {
this.router.navigate(['/user-info'], {
queryParams: {
@ -136,6 +134,8 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
}
});
}
}
});
}));
}