remotes/1693045480750635534/spooky-22
Aevann1 2021-07-23 22:31:29 +02:00
parent 64df374d27
commit a1d3fd45ee
2 changed files with 4 additions and 6 deletions

View File

@ -558,7 +558,7 @@ def request_2fa_disable():
message="If username, password, and email match, we will send you an email.") message="If username, password, and email match, we will send you an email.")
#compute token #compute token
valid=int(time.time())+60*60*24*3 valid=int(time.time())
token=generate_hash(f"{user.id}+{user.username}+disable2fa+{valid}+{user.mfa_secret}+{user.login_nonce}") token=generate_hash(f"{user.id}+{user.username}+disable2fa+{valid}+{user.mfa_secret}+{user.login_nonce}")
action_url=f"https://{app.config['SERVER_NAME']}/reset_2fa?id={user.base36id}&t={valid}&token={token}" action_url=f"https://{app.config['SERVER_NAME']}/reset_2fa?id={user.base36id}&t={valid}&token={token}"
@ -580,11 +580,7 @@ def reset_2fa():
now=int(time.time()) now=int(time.time())
t=int(request.args.get("t")) t=int(request.args.get("t"))
if now<t: if now > t+3600*24:
return render_template("message.html",
title="Inactive Link",
error="That link isn't active yet. Try again later.")
elif now > t+3600*24:
return render_template("message.html", return render_template("message.html",
title="Expired Link", title="Expired Link",
error="That link has expired.") error="That link has expired.")

View File

@ -94,6 +94,8 @@ def publish(pid, v):
def submit_get(v): def submit_get(v):
if v and v.is_banned and not v.unban_utc: return render_template("seized.html") if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
resize()
b = get_guild("general") b = get_guild("general")
return render_template("submit.html", return render_template("submit.html",