From b6875a3c377bb0662c980f0a22462193c4abb2cb Mon Sep 17 00:00:00 2001 From: MicLon <62975647+mic1on@users.noreply.github.com> Date: Fri, 6 Feb 2026 14:08:07 +0800 Subject: [PATCH] Fix captcha and user validation order logic error (#1065) --- backend/app/admin/service/auth_service.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/app/admin/service/auth_service.py b/backend/app/admin/service/auth_service.py index e8ac7d1f..859b22d1 100644 --- a/backend/app/admin/service/auth_service.py +++ b/backend/app/admin/service/auth_service.py @@ -99,8 +99,6 @@ class AuthService: """ user = None try: - user, days_remaining = await self.user_verify(db, obj.username, obj.password) - await load_login_config(db) if settings.LOGIN_CAPTCHA_ENABLED: if not obj.uuid or not obj.captcha: @@ -112,6 +110,7 @@ class AuthService: raise errors.CustomError(error=CustomErrorCode.CAPTCHA_ERROR) await redis_client.delete(f'{settings.LOGIN_CAPTCHA_REDIS_PREFIX}:{obj.uuid}') + user, days_remaining = await self.user_verify(db, obj.username, obj.password) await user_dao.update_login_time(db, obj.username) await db.refresh(user) access_token_data = await create_access_token(