Skip to content

Commit 1911006

Browse files
committed
fix: return err
1 parent f4a0d5b commit 1911006

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kaiyuanshe/controllers/auth.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ func HandleRegister(c *gin.Context) {
149149
verifyToken, err := utils.GenerateEmailVerificationToken(24)
150150
if err != nil {
151151
utils.ErrorResponse(c, http.StatusInternalServerError, "Internal server error", nil)
152+
return
152153
}
153154

154155
user := models.User{
@@ -172,6 +173,7 @@ func HandleRegister(c *gin.Context) {
172173
logger.Log.Errorf("发送验证邮件失败: %v", err)
173174
// 可以选择继续返回成功,但记录错误
174175
utils.ErrorResponse(c, http.StatusInternalServerError, "Could not send email", nil)
176+
return
175177
}
176178

177179
utils.SuccessResponse(c, http.StatusOK, "Registration successful", nil)

0 commit comments

Comments
 (0)