master
Aevann1 2022-02-26 20:29:00 +02:00
parent bdc3e36606
commit f051ef00ee
4 changed files with 4 additions and 15 deletions

3
.gitignore vendored
View File

@ -10,5 +10,4 @@ venv/
.sass-cache/
flask_session/
.DS_Store
disable_signups
verified
disable_signups

View File

@ -28,14 +28,9 @@ month = datetime.now().strftime('%B')
def merge(v, id1, id2):
if v.id != AEVANN_ID: abort(403)
with open('verified', 'r') as f:
verified = int(f.read())
if time.time() - verified > 5:
if time.time() - session.get('verified', 0) > 5:
session.pop("session_id", None)
session.pop("lo_user", None)
with open('verified', 'w') as f:
f.write(str(int(time.time())))
path = request.path
qs = urlencode(dict(request.values))
argval = quote(f"{path}?{qs}", safe='')
@ -93,14 +88,9 @@ def merge(v, id1, id2):
def merge_all(v, id):
if v.id != AEVANN_ID: abort(403)
with open('verified', 'r') as f:
verified = int(f.read())
if time.time() - verified > 5:
if time.time() - session.get('verified', 0) > 5:
session.pop("session_id", None)
session.pop("lo_user", None)
with open('verified', 'w') as f:
f.write(str(int(time.time())))
path = request.path
qs = urlencode(dict(request.values))
argval = quote(f"{path}?{qs}", safe='')

View File

@ -142,6 +142,7 @@ def login_post():
session["session_id"] = token_hex(49)
session["lo_user"] = account.id
session["login_nonce"] = account.login_nonce
if v.id == AEVANN_ID: session["verified"] = time.time()
g.db.commit()

View File

@ -1 +0,0 @@
1645891410