chore(auth): #331 add sign up verify tests
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 46s

This commit is contained in:
2024-12-25 21:50:09 +01:00
parent 397442767a
commit 0b9b478d56
5 changed files with 137 additions and 18 deletions

View File

@@ -171,11 +171,17 @@ func (handler AuthImpl) handleSignUpVerifyResponsePage() http.HandlerFunc {
err := handler.service.VerifyUserEmail(token)
if err != nil {
utils.DoRedirect(w, r, "/auth/signin")
isVerified := err == nil
comp := auth.VerifyResponseComp(isVerified)
var status int
if isVerified {
status = http.StatusOK
} else {
utils.DoRedirect(w, r, "/")
status = http.StatusBadRequest
}
handler.render.RenderLayoutWithStatus(r, w, comp, nil, status)
}
}