Remove unused asyncio import from auth_service
This commit is contained in:
@@ -7,8 +7,6 @@ survive server restarts.
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
|
||||||
from app.utils.async_utils import run_blocking
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import hmac
|
import hmac
|
||||||
import secrets
|
import secrets
|
||||||
@@ -17,6 +15,8 @@ from typing import TYPE_CHECKING
|
|||||||
import bcrypt
|
import bcrypt
|
||||||
import structlog
|
import structlog
|
||||||
|
|
||||||
|
from app.utils.async_utils import run_blocking
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
@@ -72,7 +72,6 @@ async def _check_password(plain: str, hashed: str) -> bool:
|
|||||||
"""
|
"""
|
||||||
plain_bytes = plain.encode()
|
plain_bytes = plain.encode()
|
||||||
hashed_bytes = hashed.encode()
|
hashed_bytes = hashed.encode()
|
||||||
loop = asyncio.get_running_loop()
|
|
||||||
return await run_blocking(lambda: bool(bcrypt.checkpw(plain_bytes, hashed_bytes)))
|
return await run_blocking(lambda: bool(bcrypt.checkpw(plain_bytes, hashed_bytes)))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user