fix: 修复 login_use_case.py 的 jwt_service 导入路径(P0 登录401) #67
Reference in New Issue
Block a user
Delete Branch "fix/login-jwt-import"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
登录接口返回 401,注册成功但无法登录。
根因
login_use_case.py第14行:这导入的是
jwt_service.py模块对象,而非模块底部的_JWTServiceProxy实例。因此
jwt_service.config.SECRET_KEY→AttributeError(模块没有config属性),被except Exception吞掉后返回 401。修复
from packages.application.auth.jwt_service import jwt_service,导入 proxy 实例RefreshTokenUseCase.__init__移除冗余的本地重导入,直接使用模块级 proxy影响范围
LoginUseCase.execute()— 登录RefreshTokenUseCase.execute()— Token 刷新两个核心认证路径都受此 Bug 影响。