From d798d3695e32a7e54f2ec0f4978fd81d3b725b2f Mon Sep 17 00:00:00 2001 From: Cliff Hill Date: Wed, 6 Nov 2024 10:48:28 -0500 Subject: [PATCH] More little fixes. Signed-off-by: Cliff Hill --- app/notify_client/invite_api_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/notify_client/invite_api_client.py b/app/notify_client/invite_api_client.py index 6f8555af0..7dbdca0e5 100644 --- a/app/notify_client/invite_api_client.py +++ b/app/notify_client/invite_api_client.py @@ -1,3 +1,4 @@ +import json import secrets from urllib.parse import unquote @@ -52,10 +53,11 @@ class InviteApiClient(NotifyAdminAPIClient): # make and store the nonce nonce = secrets.token_urlsafe() nonce_key = f"login-nonce-{unquote(nonce)}" - redis_client.set(f"{nonce_key}", nonce) # save the nonce to redis. + redis_client.set(nonce_key, nonce) # save the nonce to redis. + invite_data_key = f"invitedata-{state}" redis_invite_data = json.dumps(data) - redis_client.set(f"invitedata-{state}", json.dumps(invite_data), ex=ttl) + redis_client.set(invite_data_key, redis_invite_data) data["nonce"] = nonce # This is passed to api for the invite url. data["state"] = state # This is passed to api for the invite url.