mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-08-17 08:00:34 +02:00
fix campaign template cant be both SMTP and API Sender set
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -125,6 +125,15 @@ func (c *CampaignTemplate) Validate() error {
|
||||
)
|
||||
}
|
||||
|
||||
// validate that smtp configuration and api sender are mutually exclusive
|
||||
_, errSMTP := c.SMTPConfigurationID.Get()
|
||||
_, errAPISender := c.APISenderID.Get()
|
||||
if errSMTP == nil && errAPISender == nil {
|
||||
return errs.NewValidationError(
|
||||
errors.New("smtp configuration and api sender cannot both be set"),
|
||||
)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,13 @@
|
||||
modalText = getModalText('template', modalMode);
|
||||
}
|
||||
|
||||
// clear smtp or api sender when switching template type
|
||||
$: if (formValues.templateType === 'Email') {
|
||||
formValues.apiSender = null;
|
||||
} else if (formValues.templateType === 'External API') {
|
||||
formValues.smtpConfiguration = null;
|
||||
}
|
||||
|
||||
// hooks
|
||||
onMount(() => {
|
||||
const context = appStateService.getContext();
|
||||
|
||||
Reference in New Issue
Block a user