change endpoint path to be the same as GET version

pull/102/head
Aevann 2023-01-27 11:53:04 +02:00
parent 08bbe29726
commit d01d6e183a
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ from files.routes.routehelpers import check_for_alts
from files.routes.wrappers import *
NO_LOGIN_REDIRECT_URLS = ("/login", "/logout", "/signup", "/forgot", "/reset", "/reset_2fa", "/request_2fa_disable")
NO_LOGIN_REDIRECT_URLS = ("/login", "/logout", "/signup", "/forgot", "/reset", "/reset_2fa", "/lost_2fa")
@app.get("/login")
@auth_desired
@ -473,9 +473,9 @@ def lost_2fa(v:Optional[User]):
if v and not v.mfa_secret: abort(400, "You don't have 2FA enabled")
return render_template("login/lost_2fa.html", v=v)
@app.post("/request_2fa_disable")
@app.post("/lost_2fa")
@limiter.limit("1/second;6/minute;200/hour;1000/day")
def request_2fa_disable():
def lost_2fa_post():
username=request.values.get("username")
user=get_user(username, graceful=True)
if not user or not user.email or not user.mfa_secret:

View File

@ -4,7 +4,7 @@
{% block authtext %}If all information is correct, you will be able to remove 2-factor authentication from your account in 24 hours.{% endblock %}
{% block content %}
<div id="login-form">
<form action="/request_2fa_disable" method="post" class="mt-3">
<form action="/lost_2fa" method="post" class="mt-3">
<label for="username" class="mt-3">Username</label>
<input autocomplete="off" class="form-control" id="username" type="text" name="username" required{% if v %} value="{{v.username}}" disabled{% endif %}>
<label for="email" class="mt-3">Password</label>