fix: resolver problema de resolucion de modulo jwt y corregir lints de JobsView y service
This commit is contained in:
@@ -16,6 +16,7 @@ logger = logging.getLogger("uvicorn.error")
|
||||
@router.post("/login", response_model=TokenResponse)
|
||||
async def login(credentials: LoginRequest, db: AsyncSession = Depends(get_db)):
|
||||
email_clean = credentials.email.strip().lower()
|
||||
|
||||
result = await db.execute(select(User).where(User.email == email_clean))
|
||||
user = result.scalar_one_or_none()
|
||||
|
||||
|
||||
@@ -15,7 +15,10 @@ def verify_password(plain_password: str, hashed_password: str) -> bool:
|
||||
"""Verifies a plain password against a bcrypt hash."""
|
||||
try:
|
||||
return bcrypt.checkpw(plain_password.encode("utf-8"), hashed_password.encode("utf-8"))
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
print(f">> verify_password Exception: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return False
|
||||
|
||||
def create_access_token(subject: Any, role: str = "ADMIN", expires_delta: Optional[timedelta] = None) -> str:
|
||||
|
||||
Reference in New Issue
Block a user