From d639abfbc53ec82b350d895980ceba90859d4b85 Mon Sep 17 00:00:00 2001 From: IluaAir Date: Sat, 19 Jul 2025 12:10:00 +0300 Subject: [PATCH] service auth fix --- src/schemas/users.py | 2 -- src/services/auth.py | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/schemas/users.py b/src/schemas/users.py index ff9cbf3..29ffb23 100644 --- a/src/schemas/users.py +++ b/src/schemas/users.py @@ -32,6 +32,4 @@ class UserRequestADD(BaseModel): class UserAdd(BaseModel): email: EmailStr | None username: str - is_active: bool - is_superuser: bool hashed_password: str diff --git a/src/services/auth.py b/src/services/auth.py index c726333..6c0b719 100644 --- a/src/services/auth.py +++ b/src/services/auth.py @@ -13,8 +13,6 @@ class AuthService(BaseService): username=cred.username, email=cred.email, hashed_password=hashed_pass, - is_active=True, - is_superuser=False, ) result = await self.session.user.create_one(user_to_insert) await self.session.commit() @@ -31,7 +29,7 @@ class AuthService(BaseService): verify = AuthManager.verify_password( plain_password=password, hashed_password=user.hashed_password ) - if not verify: + if not verify or user.is_active is False: raise HTTPException( status_code=401, detail="Incorrect username or password",