1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-01 20:05:23 +02:00

fix(settings): fix crash during settings update when not using oauth [EE-7031] (#11662)

This commit is contained in:
Matt Hook 2024-04-23 12:58:28 +12:00 committed by GitHub
parent d177a70c54
commit 4f4c685085
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,8 +96,10 @@ func (payload *settingsUpdatePayload) Validate(r *http.Request) error {
} }
} }
if payload.OAuthSettings.AuthStyle < oauth2.AuthStyleAutoDetect || payload.OAuthSettings.AuthStyle > oauth2.AuthStyleInHeader { if payload.OAuthSettings != nil {
return errors.New("Invalid OAuth AuthStyle") if payload.OAuthSettings.AuthStyle < oauth2.AuthStyleAutoDetect || payload.OAuthSettings.AuthStyle > oauth2.AuthStyleInHeader {
return errors.New("Invalid OAuth AuthStyle")
}
} }
return nil return nil
} }