From c3e8fcd8ce98b478c9e4c86571ca21b0ecc91663 Mon Sep 17 00:00:00 2001 From: Tracker-Friendly Date: Sun, 19 Nov 2023 11:43:23 +0000 Subject: [PATCH] Generate a new token each request to /api --- app.py | 3 +++ config.ini | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 6f341f0..998ecb2 100644 --- a/app.py +++ b/app.py @@ -122,6 +122,9 @@ def register(): # Token mismatch, handle accordingly return "Token Expired", 400 + # Generate a new unique token for the next request + session['unique_token'] = str(uuid.uuid4()) + # Report the user captcha result print(user_captcha) diff --git a/config.ini b/config.ini index 53b56e3..8525cbd 100644 --- a/config.ini +++ b/config.ini @@ -1,5 +1,5 @@ [HectaMail] # Secret Key, please change to something custom -secretkey: 'your_key_here' +secretkey: secret_key_here # The characters you allow in your CAPTCHA -captchachars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +captchachars: ABCDEFGHIJKLMNOPQRSTUVWXYZ