mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:47:33 +00:00
fix: smtp provider (#8610)
There were some problems after changing from SMTP providers to email providers (https://github.com/zitadel/zitadel/pull/8545): - panic (nil pointer) on SMTP provider retrieval for HTTP configs - old SMTP configuration created before the multi SMTP configurations (without id) - were not projected / listed - could not be always be activated - Console treated HTTP configs as SMTP --------- Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
@@ -20,17 +20,20 @@ func listSMTPConfigsToModel(req *admin_pb.ListSMTPConfigsRequest) (*query.SMTPCo
|
||||
}
|
||||
|
||||
func SMTPConfigToProviderPb(config *query.SMTPConfig) *settings_pb.SMTPConfig {
|
||||
return &settings_pb.SMTPConfig{
|
||||
Details: object.ToViewDetailsPb(config.Sequence, config.CreationDate, config.ChangeDate, config.ResourceOwner),
|
||||
Id: config.ID,
|
||||
Description: config.Description,
|
||||
Tls: config.SMTPConfig.TLS,
|
||||
Host: config.SMTPConfig.Host,
|
||||
User: config.SMTPConfig.User,
|
||||
State: SMTPConfigStateToPb(config.State),
|
||||
SenderAddress: config.SMTPConfig.SenderAddress,
|
||||
SenderName: config.SMTPConfig.SenderName,
|
||||
ret := &settings_pb.SMTPConfig{
|
||||
Details: object.ToViewDetailsPb(config.Sequence, config.CreationDate, config.ChangeDate, config.ResourceOwner),
|
||||
Id: config.ID,
|
||||
Description: config.Description,
|
||||
State: SMTPConfigStateToPb(config.State),
|
||||
}
|
||||
if config.SMTPConfig != nil {
|
||||
ret.Tls = config.SMTPConfig.TLS
|
||||
ret.Host = config.SMTPConfig.Host
|
||||
ret.User = config.SMTPConfig.User
|
||||
ret.SenderAddress = config.SMTPConfig.SenderAddress
|
||||
ret.SenderName = config.SMTPConfig.SenderName
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func SMTPConfigsToPb(configs []*query.SMTPConfig) []*settings_pb.SMTPConfig {
|
||||
|
Reference in New Issue
Block a user