diff --git a/backend/src/module/database/user.py b/backend/src/module/database/user.py index dc01a9b0..336f81f4 100644 --- a/backend/src/module/database/user.py +++ b/backend/src/module/database/user.py @@ -24,6 +24,10 @@ class UserDatabase: def auth_user(self, user: User): statement = select(User).where(User.username == user.username) result = self.session.exec(statement).first() + if not user.password: + return ResponseModel( + status_code=401, status=False, msg_en="Incorrect password format", msg_zh="密码格式不正确" + ) if not result: return ResponseModel( status_code=401, status=False, msg_en="User not found", msg_zh="用户不存在"