Formatting everything with black
This commit is contained in:
1 parent
42a11c0dc6
commit
a3539beda9
20 files changed
+173
-18
No files matched your search
@@ -1,4 +1,5 @@
|
||||
"""Password hashing and JWT token helpers."""
|
||||
|
||||
import hashlib
|
||||
import uuid
|
||||
from datetime import UTC, datetime, timedelta
|
||||
@@ -14,6 +15,7 @@ REFRESH_TOKEN_TYPE = "refresh"
|
||||
|
||||
# --- Passwords ---------------------------------------------------------------
|
||||
|
||||
|
||||
def hash_password(password: str) -> str:
|
||||
return bcrypt.hashpw(password.encode(), bcrypt.gensalt()).decode()
|
||||
|
||||
@@ -27,6 +29,7 @@ def verify_password(password: str, hashed: str) -> bool:
|
||||
|
||||
# --- JWT ---------------------------------------------------------------------
|
||||
|
||||
|
||||
def _create_token(
|
||||
subject: str | int,
|
||||
expires_delta: timedelta,
|
||||
|
||||
Reference in new issue
Block a user