This is an automated email from the ASF dual-hosted git repository. linkinstar pushed a commit to branch feat/1.5.0/user in repository https://gitbox.apache.org/repos/asf/answer.git
commit ef30ef228dcc1a5705ffaeb175b43f20927bc4bc Author: LinkinStars <[email protected]> AuthorDate: Thu Apr 17 10:33:53 2025 +0800 feat(user): user can't login when suspended --- internal/controller/user_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/controller/user_controller.go b/internal/controller/user_controller.go index b418f601..c8ffd7fe 100644 --- a/internal/controller/user_controller.go +++ b/internal/controller/user_controller.go @@ -162,6 +162,11 @@ func (uc *UserController) UserEmailLogin(ctx *gin.Context) { if !isAdmin { uc.actionService.ActionRecordDel(ctx, entity.CaptchaActionPassword, ctx.ClientIP()) } + if resp.Status == constant.UserSuspended { + handler.HandleResponse(ctx, errors.Forbidden(reason.UserSuspended), + &schema.ForbiddenResp{Type: schema.ForbiddenReasonTypeUserSuspended}) + return + } uc.setVisitCookies(ctx, resp.VisitToken, true) handler.HandleResponse(ctx, nil, resp) }
