mirror of
https://github.com/simon987/od-database.git
synced 2025-12-13 23:09:01 +00:00
Fix captcha part 2: don't store captcha answer in session cookie
This commit is contained in:
5
api.py
5
api.py
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
import os
|
||||
from threading import Lock
|
||||
from uuid import uuid4
|
||||
|
||||
from flask import request, abort, Response, send_file, session
|
||||
|
||||
@@ -254,7 +255,9 @@ def setup_api(app):
|
||||
@app.route("/cap", methods=["GET"])
|
||||
def cap():
|
||||
word = captcha.make_captcha()
|
||||
session["cap"] = word
|
||||
cap_id = uuid4()
|
||||
session["cap"] = cap_id
|
||||
oddb.sessionStore[cap_id] = word
|
||||
|
||||
return send_file(captcha.get_path(word), cache_timeout=0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user