mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Merge pull request #14910 from reasonerjt/fix-oidc-callback-nil-pointer
Check user in security context before getting the ID
This commit is contained in:
commit
4492e47e89
2
.github/workflows/CI.yml
vendored
2
.github/workflows/CI.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
||||
- name: setup Docker
|
||||
uses: docker-practice/actions-setup-docker@0.0.1
|
||||
with:
|
||||
docker_version: 18.09
|
||||
docker_version: 20.04
|
||||
docker_channel: stable
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
|
@ -113,7 +113,7 @@ func (c *controller) Get(ctx context.Context, id int, opt *Option) (*models.User
|
||||
return nil, fmt.Errorf("can't find security context")
|
||||
}
|
||||
lsc, ok := sctx.(*local.SecurityContext)
|
||||
if ok && lsc.User().UserID == id {
|
||||
if ok && lsc.User() != nil && lsc.User().UserID == id {
|
||||
u.AdminRoleInAuth = lsc.User().AdminRoleInAuth
|
||||
}
|
||||
if opt != nil && opt.WithOIDCInfo {
|
||||
|
Loading…
Reference in New Issue
Block a user