sfdfsd
This commit is contained in:
parent
470dd39ea5
commit
3890300e06
1 changed files with 1 additions and 4 deletions
|
@ -79,6 +79,7 @@ def check_for_alts(current_id):
|
||||||
@limiter.limit("1/second")
|
@limiter.limit("1/second")
|
||||||
@limiter.limit("6/minute")
|
@limiter.limit("6/minute")
|
||||||
def login_post():
|
def login_post():
|
||||||
|
template = ''
|
||||||
|
|
||||||
username = request.values.get("username")
|
username = request.values.get("username")
|
||||||
|
|
||||||
|
@ -91,7 +92,6 @@ def login_post():
|
||||||
|
|
||||||
if not account:
|
if not account:
|
||||||
time.sleep(random.uniform(0, 2))
|
time.sleep(random.uniform(0, 2))
|
||||||
template = ''
|
|
||||||
return render_template(f"{template}login.html", failed=True)
|
return render_template(f"{template}login.html", failed=True)
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,13 +99,11 @@ def login_post():
|
||||||
|
|
||||||
if not account.verifyPass(request.values.get("password")):
|
if not account.verifyPass(request.values.get("password")):
|
||||||
time.sleep(random.uniform(0, 2))
|
time.sleep(random.uniform(0, 2))
|
||||||
template = ''
|
|
||||||
return render_template(f"{template}login.html", failed=True)
|
return render_template(f"{template}login.html", failed=True)
|
||||||
|
|
||||||
if account.mfa_secret:
|
if account.mfa_secret:
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
hash = generate_hash(f"{account.id}+{now}+2fachallenge")
|
hash = generate_hash(f"{account.id}+{now}+2fachallenge")
|
||||||
template = ''
|
|
||||||
return render_template(f"{template}login_2fa.html",
|
return render_template(f"{template}login_2fa.html",
|
||||||
v=account,
|
v=account,
|
||||||
time=now,
|
time=now,
|
||||||
|
@ -126,7 +124,6 @@ def login_post():
|
||||||
|
|
||||||
if not account.validate_2fa(request.values.get("2fa_token", "").strip()):
|
if not account.validate_2fa(request.values.get("2fa_token", "").strip()):
|
||||||
hash = generate_hash(f"{account.id}+{time}+2fachallenge")
|
hash = generate_hash(f"{account.id}+{time}+2fachallenge")
|
||||||
template = ''
|
|
||||||
return render_template(f"{template}login_2fa.html",
|
return render_template(f"{template}login_2fa.html",
|
||||||
v=account,
|
v=account,
|
||||||
time=now,
|
time=now,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue