forked from polka_billy/porridger
Fixed async-await bugs
This commit is contained in:
@ -30,11 +30,11 @@ async def get_session() -> AsyncSession:
|
||||
yield session
|
||||
|
||||
|
||||
async def verify_password(plain_password, hashed_password):
|
||||
def verify_password(plain_password, hashed_password):
|
||||
return pwd_context.verify(plain_password, hashed_password)
|
||||
|
||||
|
||||
async def get_password_hash(password):
|
||||
def get_password_hash(password):
|
||||
return pwd_context.hash(password)
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ async def authenticate_user(db: Annotated[AsyncSession, Depends(get_session)], n
|
||||
return user
|
||||
|
||||
|
||||
async def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
|
||||
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
|
||||
to_encode = data.copy()
|
||||
if expires_delta:
|
||||
expire = datetime.utcnow() + expires_delta
|
||||
@ -95,7 +95,7 @@ async def get_current_user(db: Annotated[AsyncSession, Depends(get_session)], to
|
||||
disabled=user.disabled, items=user.announcements, reg_date=user.reg_date, points=user.points)
|
||||
|
||||
|
||||
async def get_current_active_user(
|
||||
def get_current_active_user(
|
||||
current_user: Annotated[pydantic_schemas.User, Depends(get_current_user)]
|
||||
):
|
||||
if current_user.disabled:
|
||||
|
Reference in New Issue
Block a user