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",