mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-05 12:47:29 +01:00
Fix user claim verification token not being remembered due to multiple nodes
This commit is contained in:
parent
a947472c67
commit
002e6828b6
@ -29,8 +29,6 @@ from app.utils import rank_required, randomString, loginUser
|
|||||||
from app.tasks.forumtasks import checkForumAccount
|
from app.tasks.forumtasks import checkForumAccount
|
||||||
from app.tasks.emails import sendVerifyEmail
|
from app.tasks.emails import sendVerifyEmail
|
||||||
from app.tasks.phpbbparser import getProfile
|
from app.tasks.phpbbparser import getProfile
|
||||||
from werkzeug.contrib.cache import SimpleCache
|
|
||||||
cache = SimpleCache()
|
|
||||||
|
|
||||||
# Define the User profile form
|
# Define the User profile form
|
||||||
class UserProfileForm(FlaskForm):
|
class UserProfileForm(FlaskForm):
|
||||||
@ -176,10 +174,12 @@ def user_claim_page():
|
|||||||
if user is not None and method == "github":
|
if user is not None and method == "github":
|
||||||
return redirect(url_for("github_signin_page"))
|
return redirect(url_for("github_signin_page"))
|
||||||
|
|
||||||
token = cache.get("forum_claim_key_" + request.remote_addr)
|
token = None
|
||||||
if token is None:
|
if "forum_token" in session:
|
||||||
|
token = session["forum_token"]
|
||||||
|
else:
|
||||||
token = randomString(32)
|
token = randomString(32)
|
||||||
cache.set("forum_claim_key_" + request.remote_addr, token, 5*60)
|
session["forum_token"] = token
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
ctype = request.form.get("claim_type")
|
ctype = request.form.get("claim_type")
|
||||||
|
Loading…
Reference in New Issue
Block a user