forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-05-26 00:26:03 +02:00
parent 987e479aa4
commit 4859fc7363
1 changed files with 3 additions and 5 deletions

View File

@ -6,6 +6,7 @@ from urllib.parse import quote
from files.helpers.security import *
from files.helpers.wrappers import *
from files.helpers.const import *
from files.helpers.get import *
from files.classes import *
from files.__main__ import app, mail, limiter
from flask_mail import Message
@ -61,7 +62,6 @@ def activate(v):
id = request.values.get("id", "").strip()
if not id: abort(400)
timestamp = int(request.values.get("time", "0"))
token = request.values.get("token", "").strip()
@ -69,13 +69,11 @@ def activate(v):
return render_template("message.html", v=v, title="Verification link expired.",
message="That link has expired. Visit your settings to send yourself another verification email."), 410
user = get_account(id)
if not validate_hash(f"{email}+{id}+{timestamp}", token):
abort(403)
user = g.db.query(User).filter_by(id=id).one_or_none()
if not user:
abort(404)
if user.is_activated and user.email == email:
return render_template("message_success.html", v=v, title="Email already verified.", message="Email already verified."), 404