Merge pull request #9200 from ywk253100/190923_oidc_ping

Return a common error message when testing the oidc provider
This commit is contained in:
Wenkai Yin(尹文开) 2019-09-24 18:49:23 +08:00 committed by GitHub
commit 4192a692cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@ package api
import (
"errors"
"github.com/goharbor/harbor/src/common/utils/log"
"github.com/goharbor/harbor/src/common/utils/oidc"
)
@ -50,7 +51,7 @@ func (oa *OIDCAPI) Ping() {
}
if err := oidc.TestEndpoint(c); err != nil {
log.Errorf("Failed to verify connection: %+v, err: %v", c, err)
oa.SendBadRequestError(err)
oa.SendBadRequestError(errors.New("failed to verify connection"))
return
}
}