aboutsummaryrefslogtreecommitdiffstats
path: root/authentication/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'authentication/utils.py')
-rw-r--r--authentication/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/authentication/utils.py b/authentication/utils.py
index 4f19bc3..b0c9989 100644
--- a/authentication/utils.py
+++ b/authentication/utils.py
@@ -15,11 +15,11 @@ def bcrypt_sha256_hash(password: str) -> str:
15def bcrypt_sha256_verify(password: str, hashed: str) -> bool: 15def bcrypt_sha256_verify(password: str, hashed: str) -> bool:
16 digest = hashlib.sha256(password.encode("utf-8")).digest() 16 digest = hashlib.sha256(password.encode("utf-8")).digest()
17 encoded = base64.b64encode(digest) 17 encoded = base64.b64encode(digest)
18 return bcrypt.checkpw(encoded, hashed.encode('utf-8')) 18 return bcrypt.checkpw(encoded, hashed.encode("utf-8"))
19 19
20 20
21def get_url_path_with_query(app: FastAPI, name: str, params: dict | None = None, /, **path_params: str): 21def get_url_path_with_query(
22 app: FastAPI, name: str, params: dict | None = None, /, **path_params: str
23):
22 base = app.url_path_for(name, **path_params) 24 base = app.url_path_for(name, **path_params)
23 return base + '?' + urlencode(params) if params is not None else base 25 return base + "?" + urlencode(params) if params is not None else base
24
25