Fix bug with redirect to login caused by fixed of role verification
This commit is contained in:
parent
ac58161c93
commit
56a8a035cc
|
@ -104,12 +104,12 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
if (this.user) {
|
if (this.paramsSubscription instanceof Subscription) {
|
||||||
if(this.paramsSubscription instanceof Subscription) {
|
this.paramsSubscription.unsubscribe();
|
||||||
this.paramsSubscription.unsubscribe();
|
}
|
||||||
}
|
this.paramsSubscription = this.route.queryParams.subscribe(params => {
|
||||||
this.paramsSubscription = this.route.queryParams.subscribe(params => {
|
if (params && params['verify']) {
|
||||||
if (params && params['verify']) {
|
if (this.user) {
|
||||||
this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {
|
this.subscriptions.push(this.userRegistryService.getInvitation(params['verify']).subscribe(verification => {
|
||||||
this.verification = verification;
|
this.verification = verification;
|
||||||
if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) {
|
if (this.user.email === this.verification.email.toLowerCase() && this.id === this.verification.entity && this.type === this.verification.type) {
|
||||||
|
@ -126,21 +126,21 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
||||||
}, error => {
|
}, error => {
|
||||||
this.openErrorModal();
|
this.openErrorModal();
|
||||||
}));
|
}));
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['/user-info'], {
|
||||||
|
queryParams: {
|
||||||
|
'errorCode': LoginErrorCodes.NOT_LOGIN,
|
||||||
|
'redirectUrl': this.router.url
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
this.router.navigate(['/user-info'], {
|
|
||||||
queryParams: {
|
|
||||||
'errorCode': LoginErrorCodes.NOT_LOGIN,
|
|
||||||
'redirectUrl': this.router.url
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
if(this.paramsSubscription instanceof Subscription) {
|
if (this.paramsSubscription instanceof Subscription) {
|
||||||
this.paramsSubscription.unsubscribe();
|
this.paramsSubscription.unsubscribe();
|
||||||
}
|
}
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
|
|
Loading…
Reference in New Issue