Nonce is working now for invites.

Signed-off-by: Cliff Hill <clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-10-15 16:52:29 -04:00
parent da6882774b
commit 8c40538334
4 changed files with 12 additions and 15 deletions

View File

@@ -18,6 +18,7 @@ from notifications_utils.url_safe_token import generate_token
def index():
if current_user and current_user.is_authenticated:
return redirect(url_for("main.choose_account"))
token = generate_token(
str(request.remote_addr),
current_app.config["SECRET_KEY"],
@@ -26,9 +27,11 @@ def index():
url = os.getenv("LOGIN_DOT_GOV_INITIAL_SIGNIN_URL")
# handle unit tests
current_app.logger.warning(f"############### {str(request.remote_addr)}")
nonce = secrets.token_urlsafe()
redis_key = f"login-nonce-{unquote(token)}"
redis_key = f"login-nonce-{unquote(nonce)}"
redis_client.set(redis_key, nonce)
if url is not None: