Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Commit efd7c0c

Browse files
committed
fix: user verification (resolve #51)
1 parent 6d61fe9 commit efd7c0c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

service/user.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ package service
33
import (
44
"errors"
55
"fmt"
6+
"strings"
7+
"time"
8+
69
"github.com/emvi/logbuch"
710
conf "github.com/muety/mailwhale/config"
811
"github.com/muety/mailwhale/types"
912
"github.com/muety/mailwhale/types/dto"
1013
"github.com/muety/mailwhale/util"
1114
"github.com/timshannon/bolthold"
12-
"strings"
13-
"time"
1415
)
1516

1617
type UserService struct {
@@ -51,6 +52,7 @@ func (s *UserService) Create(signup *dto.Signup) (*types.User, error) {
5152
Password: util.HashBcrypt(signup.Password, s.config.Security.Pepper),
5253
Senders: []types.SenderAddress{},
5354
CreatedAt: time.Now(),
55+
Verified: !s.config.Security.VerifyUsers,
5456
}
5557
if !user.IsValid() {
5658
return nil, errors.New("can't create user (empty password or invalid e-mail address)")

0 commit comments

Comments
 (0)