mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-26 01:21:22 +01:00
Merge pull request #8494 from jwangyangls/fix-global-search
Fix redirect login page when enter harbor through global search
This commit is contained in:
commit
4921b0fb4c
@ -41,8 +41,19 @@ export class MemberGuard implements CanActivate, CanActivateChild {
|
|||||||
this.checkMemberStatus(state.url, projectId).subscribe((res) => observer.next(res));
|
this.checkMemberStatus(state.url, projectId).subscribe((res) => observer.next(res));
|
||||||
}
|
}
|
||||||
, error => {
|
, error => {
|
||||||
this.router.navigate([CommonRoutes.HARBOR_DEFAULT]);
|
// if it is public project return true;
|
||||||
observer.next(false);
|
this.projectService.getProject(projectId).subscribe(project => {
|
||||||
|
if (project.metadata.public) {
|
||||||
|
observer.next(true);
|
||||||
|
} else {
|
||||||
|
this.router.navigate([CommonRoutes.HARBOR_DEFAULT]);
|
||||||
|
observer.next(false);
|
||||||
|
}
|
||||||
|
}, err => {
|
||||||
|
this.router.navigate([CommonRoutes.HARBOR_DEFAULT]);
|
||||||
|
observer.next(false);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.checkMemberStatus(state.url, projectId).subscribe((res) => observer.next(res));
|
this.checkMemberStatus(state.url, projectId).subscribe((res) => observer.next(res));
|
||||||
|
Loading…
Reference in New Issue
Block a user