|
@@ -849,6 +849,9 @@ func (s *InboundService) AddInboundClient(data *model.Inbound) (bool, error) {
|
|
|
|
|
|
|
|
// Secure client ID
|
|
// Secure client ID
|
|
|
for _, client := range clients {
|
|
for _, client := range clients {
|
|
|
|
|
+ if strings.TrimSpace(client.Email) == "" {
|
|
|
|
|
+ return false, common.NewError("client email is required")
|
|
|
|
|
+ }
|
|
|
switch oldInbound.Protocol {
|
|
switch oldInbound.Protocol {
|
|
|
case "trojan":
|
|
case "trojan":
|
|
|
if client.Password == "" {
|
|
if client.Password == "" {
|
|
@@ -1317,8 +1320,11 @@ func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId strin
|
|
|
if newClientId == "" || clientIndex == -1 {
|
|
if newClientId == "" || clientIndex == -1 {
|
|
|
return false, common.NewError("empty client ID")
|
|
return false, common.NewError("empty client ID")
|
|
|
}
|
|
}
|
|
|
|
|
+ if strings.TrimSpace(clients[0].Email) == "" {
|
|
|
|
|
+ return false, common.NewError("client email is required")
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if len(clients[0].Email) > 0 && clients[0].Email != oldEmail {
|
|
|
|
|
|
|
+ if clients[0].Email != oldEmail {
|
|
|
existEmail, err := s.checkEmailsExistForClients(clients)
|
|
existEmail, err := s.checkEmailsExistForClients(clients)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return false, err
|
|
return false, err
|