fix: tolerate nil secret when tokenEndpointAuthMethod is none (#53)

Signed-off-by: Clément BUCHART <clement@buchart.dev>
This commit is contained in:
Clément BUCHART
2020-03-26 10:19:11 +01:00
committed by GitHub
parent 38907c2ad4
commit ce3ca789ea
3 changed files with 91 additions and 6 deletions

View File

@ -28,6 +28,8 @@ type Oauth2ClientCredentials struct {
func (oj *OAuth2ClientJSON) WithCredentials(credentials *Oauth2ClientCredentials) *OAuth2ClientJSON {
oj.ClientID = pointer.StringPtr(string(credentials.ID))
oj.Secret = pointer.StringPtr(string(credentials.Password))
if credentials.Password != nil {
oj.Secret = pointer.StringPtr(string(credentials.Password))
}
return oj
}