Switch API token to bcrypt

This commit is contained in:
thePR0M3TH3AN committed 2025-08-20 19:29:08 -04:00
1 parent da37ec2e61
commit d99af30d9f
4 files changed
+21 -26

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ import sys
import pytest
from httpx import ASGITransport, AsyncClient
import hashlib
import bcrypt
sys.path.append(str(Path(__file__).resolve().parents[1]))
@@ -54,7 +54,7 @@ async def client(monkeypatch):
async def test_token_hashed(client):
_, token = client
assert api.app.state.token_hash != token
assert api.app.state.token_hash == hashlib.sha256(token.encode()).hexdigest()
assert bcrypt.checkpw(token.encode(), api.app.state.token_hash)
@pytest.mark.anyio