UseRePassWord godoc @Summary UseRePassWord @Description UseRePassWord @Tags User @Accept json @Produce json @Param data body schema.UserRePassWordRequest true "UserRePassWordRequest" @Success 200 {string} string "" @Router /answer/api/v1/user/password/replacement [post]
(ctx *gin.Context)
| 211 | // @Success 200 {string} string "" |
| 212 | // @Router /answer/api/v1/user/password/replacement [post] |
| 213 | func (uc *UserController) UseRePassWord(ctx *gin.Context) { |
| 214 | req := &schema.UserRePassWordRequest{} |
| 215 | if handler.BindAndCheck(ctx, req) { |
| 216 | return |
| 217 | } |
| 218 | |
| 219 | req.Content = uc.emailService.VerifyUrlExpired(ctx, req.Code) |
| 220 | if len(req.Content) == 0 { |
| 221 | handler.HandleResponse(ctx, errors.Forbidden(reason.EmailVerifyURLExpired), |
| 222 | &schema.ForbiddenResp{Type: schema.ForbiddenReasonTypeURLExpired}) |
| 223 | return |
| 224 | } |
| 225 | |
| 226 | err := uc.userService.UpdatePasswordWhenForgot(ctx, req) |
| 227 | uc.actionService.ActionRecordDel(ctx, entity.CaptchaActionPassword, ctx.ClientIP()) |
| 228 | handler.HandleResponse(ctx, err, nil) |
| 229 | } |
| 230 | |
| 231 | // UserLogout user logout |
| 232 | // @Summary user logout |
nothing calls this directly
no test coverage detected