diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-07 03:02:21 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-07 03:02:21 -0400 |
commit | a3fa964c585f62ccf4c4113da1dc324839122c88 (patch) | |
tree | f189f84015d8327d5d6bc7fb1b97f4362d0be2ec /internal/user | |
parent | 17326a16a018ae84d274be53b52be9273ef69932 (diff) | |
download | donetick-a3fa964c585f62ccf4c4113da1dc324839122c88.tar.gz donetick-a3fa964c585f62ccf4c4113da1dc324839122c88.tar.bz2 donetick-a3fa964c585f62ccf4c4113da1dc324839122c88.zip |
Fix Adaptive Scheduler, Update email handlers, telegram notifications
Diffstat (limited to 'internal/user')
-rw-r--r-- | internal/user/handler.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/user/handler.go b/internal/user/handler.go index 0eee6f2..15e881f 100644 --- a/internal/user/handler.go +++ b/internal/user/handler.go @@ -69,6 +69,7 @@ func (h *Handler) signUp(c *gin.Context) { type SignUpReq struct { Username string `json:"username" binding:"required,min=4,max=20"` Password string `json:"password" binding:"required,min=8,max=45"` + Email string `json:"email" binding:"required,email"` DisplayName string `json:"displayName"` } var signupReq SignUpReq @@ -96,6 +97,7 @@ func (h *Handler) signUp(c *gin.Context) { Username: signupReq.Username, Password: password, DisplayName: signupReq.DisplayName, + Email: signupReq.Email, CreatedAt: time.Now(), UpdatedAt: time.Now(), }); err != nil { @@ -281,9 +283,8 @@ func (h *Handler) resetPassword(c *gin.Context) { } user, err := h.userRepo.FindByEmail(c, req.Email) if err != nil { - c.JSON(http.StatusNotFound, gin.H{ - "error": "User not found", - }) + c.JSON(http.StatusOK, gin.H{}) + log.Error("account.handler.resetPassword failed to find user") return } if user.Provider != 0 { |