From 81261e52931d055df5830e29b9bf5ef81ba9134e Mon Sep 17 00:00:00 2001 From: stuppie Date: Tue, 1 Sep 2026 14:17:10 -0600 Subject: add a magic token flow specifically for amt account link. gr api manager add more logging and error handling --- jb/models/auth.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'jb/models') diff --git a/jb/models/auth.py b/jb/models/auth.py index 8b48088..d0e8386 100644 --- a/jb/models/auth.py +++ b/jb/models/auth.py @@ -68,7 +68,9 @@ class User(BaseModel): if not isinstance(provided_id, str) or not hmac.compare_digest( provided_id, expected_id ): - raise ValueError(f"product_user_id {provided_id} does not match email {email}") + raise ValueError( + f"product_user_id {provided_id} does not match email {email}" + ) # The computed field is authoritative; do not retain the input value. validated_data = dict(data) @@ -92,6 +94,13 @@ class MagicLinkExchangeRequest(BaseModel): token: str = Field(min_length=1) +class AmtAccountLink(BaseModel): + model_config = ConfigDict(extra="forbid") + + email: EmailStr + amt_worker_id: str = Field(min_length=3, max_length=50) + + class SessionResponse(BaseModel): session_token: str token_type: str = "bearer" -- cgit v1.2.3