@@ -542,25 +542,35 @@ func (s sms) toAuthConfigBody(body *v1API.UpdateAuthConfigBody) {
542
542
switch {
543
543
case s .Twilio .Enabled :
544
544
body .SmsProvider = cast .Ptr ("twilio" )
545
- body .SmsTwilioAuthToken = & s .Twilio .AuthToken
545
+ if len (s .Twilio .AuthToken ) > 0 {
546
+ body .SmsTwilioAuthToken = & s .Twilio .AuthToken
547
+ }
546
548
body .SmsTwilioAccountSid = & s .Twilio .AccountSid
547
549
body .SmsTwilioMessageServiceSid = & s .Twilio .MessageServiceSid
548
550
case s .TwilioVerify .Enabled :
549
551
body .SmsProvider = cast .Ptr ("twilio_verify" )
550
- body .SmsTwilioVerifyAuthToken = & s .TwilioVerify .AuthToken
552
+ if len (s .TwilioVerify .AuthToken ) > 0 {
553
+ body .SmsTwilioVerifyAuthToken = & s .TwilioVerify .AuthToken
554
+ }
551
555
body .SmsTwilioVerifyAccountSid = & s .TwilioVerify .AccountSid
552
556
body .SmsTwilioVerifyMessageServiceSid = & s .TwilioVerify .MessageServiceSid
553
557
case s .Messagebird .Enabled :
554
558
body .SmsProvider = cast .Ptr ("messagebird" )
555
- body .SmsMessagebirdAccessKey = & s .Messagebird .AccessKey
559
+ if len (s .Messagebird .AccessKey ) > 0 {
560
+ body .SmsMessagebirdAccessKey = & s .Messagebird .AccessKey
561
+ }
556
562
body .SmsMessagebirdOriginator = & s .Messagebird .Originator
557
563
case s .Textlocal .Enabled :
558
564
body .SmsProvider = cast .Ptr ("textlocal" )
559
- body .SmsTextlocalApiKey = & s .Textlocal .ApiKey
565
+ if len (s .Textlocal .ApiKey ) > 0 {
566
+ body .SmsTextlocalApiKey = & s .Textlocal .ApiKey
567
+ }
560
568
body .SmsTextlocalSender = & s .Textlocal .Sender
561
569
case s .Vonage .Enabled :
562
570
body .SmsProvider = cast .Ptr ("vonage" )
563
- body .SmsVonageApiSecret = & s .Vonage .ApiSecret
571
+ if len (s .Vonage .ApiSecret ) > 0 {
572
+ body .SmsVonageApiSecret = & s .Vonage .ApiSecret
573
+ }
564
574
body .SmsVonageApiKey = & s .Vonage .ApiKey
565
575
body .SmsVonageFrom = & s .Vonage .From
566
576
}
0 commit comments