mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-19 16:55:16 +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));
|
||||
}
|
||||
, error => {
|
||||
this.router.navigate([CommonRoutes.HARBOR_DEFAULT]);
|
||||
observer.next(false);
|
||||
// if it is public project return true;
|
||||
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 {
|
||||
this.checkMemberStatus(state.url, projectId).subscribe((res) => observer.next(res));
|
||||
|
Loading…
Reference in New Issue
Block a user