aboutsummaryrefslogtreecommitdiff
path: root/jb/models/auth.py
diff options
context:
space:
mode:
authorMax Nanis2026-09-10 01:00:39 -0700
committerMax Nanis2026-09-10 01:00:39 -0700
commit4dca7296742b607e74f16e2f6484c51163a41ace (patch)
tree0839c16d0905deb587d3ee25ff93fd3ccf7eeeb6 /jb/models/auth.py
parent832aecaddce80e312095ecdb572d7756eb9df5e9 (diff)
downloadamt-jb-4dca7296742b607e74f16e2f6484c51163a41ace.tar.gz
amt-jb-4dca7296742b607e74f16e2f6484c51163a41ace.zip
using model_validator on GRLSettings. Allows null default values, then to asser them on load. Required so pydantic_settings can be loaded in tests without params
Diffstat (limited to 'jb/models/auth.py')
-rw-r--r--jb/models/auth.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/jb/models/auth.py b/jb/models/auth.py
index fef5070..886a607 100644
--- a/jb/models/auth.py
+++ b/jb/models/auth.py
@@ -22,6 +22,7 @@ def email_to_product_user_id(email: str) -> str:
The same normalized email and secret salt always produce the same ID. Keep
the salt private and stable; changing it changes every generated ID.
"""
+ assert settings.magic_token_salt
salt_bytes = settings.magic_token_salt.get_secret_value().encode("utf-8")
if len(salt_bytes) < 32:
raise ValueError("salt must be at least 32 bytes")