Merge pull request #7869 from wy65701436/fix-auth-proxy

Add ensure settings when to search user in auth proxy
This commit is contained in:
Daniel Jiang 2019-05-23 00:13:03 +02:00 committed by GitHub
commit c924627d16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,6 +104,10 @@ func (a *Auth) PostAuthenticate(u *models.User) error {
// SearchUser returns nil as authproxy does not have such capability.
// When AlwaysOnboard is set it always return the default model.
func (a *Auth) SearchUser(username string) (*models.User, error) {
err := a.ensure()
if err != nil {
log.Warningf("Failed to refresh configuration for HTTP Auth Proxy Authenticator, error: %v, the default settings will be used", err)
}
var u *models.User
if a.AlwaysOnboard {
u = &models.User{Username: username}