refac: register only open while no verified acc exists, enforced by a use case rather than handler & sends verification email whose link uses the conf pub URL whose code expires after 2h
This commit is contained in:
1 parent
6e9e108033
commit
6d510d2805
14 files changed
+575
-30
No files matched your search
@@ -440,7 +440,7 @@ func TestDeleteImageRequiresExistence(t *testing.T) {
|
||||
|
||||
func TestCreateUserAssignsVerificationCode(t *testing.T) {
|
||||
repo := newMockUserRepo()
|
||||
uc := useCases.NewCreateUserUseCase(repo, &stubHasher{})
|
||||
uc := useCases.NewCreateUserUseCase(repo, &stubHasher{}, newMockMailRepo(), "https://cms.example.com")
|
||||
|
||||
before := time.Now()
|
||||
result, err := uc.CreateUser(useCases.CreateUserCommand{
|
||||
@@ -487,7 +487,7 @@ func TestCreateUserAssignsVerificationCode(t *testing.T) {
|
||||
func TestCreateUserPropagatesRepositoryFailure(t *testing.T) {
|
||||
repo := newMockUserRepo()
|
||||
repo.fail.failNext("Create")
|
||||
uc := useCases.NewCreateUserUseCase(repo, &stubHasher{})
|
||||
uc := useCases.NewCreateUserUseCase(repo, &stubHasher{}, newMockMailRepo(), "https://cms.example.com")
|
||||
|
||||
_, err := uc.CreateUser(useCases.CreateUserCommand{
|
||||
Username: "alice",
|
||||
|
||||
Reference in new issue
Block a user