fix auth
This commit is contained in:
@@ -7,7 +7,7 @@ from src.core.database import async_session_maker
|
||||
|
||||
|
||||
async def get_db() -> AsyncGenerator[AsyncSession, None]:
|
||||
async with async_session_maker as db:
|
||||
async with async_session_maker() as db:
|
||||
yield db
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from src.schemas.users import UserCreate
|
||||
from src.services.base import BaseService
|
||||
from src.utils.auth_manager import AuthManger
|
||||
|
||||
|
||||
class AuthService(BaseService):
|
||||
|
||||
|
||||
async def registration(self, data: UserCreate):
|
||||
...
|
||||
|
||||
|
||||
async def registration(self, cred: UserCreate):
|
||||
hashed_pass = AuthManger.get_password_hash(cred.password)
|
||||
print(cred.password)
|
||||
print(hashed_pass)
|
||||
|
||||
@@ -10,3 +10,6 @@ class DBManager:
|
||||
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
||||
await self.session.rollback()
|
||||
await self.session.close()
|
||||
|
||||
async def commit(self):
|
||||
await self.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user