forked from rDrama/rDrama
change endpoint path to be the same as GET version
parent
08bbe29726
commit
d01d6e183a
|
@ -18,7 +18,7 @@ from files.routes.routehelpers import check_for_alts
|
||||||
from files.routes.wrappers import *
|
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")
|
@app.get("/login")
|
||||||
@auth_desired
|
@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")
|
if v and not v.mfa_secret: abort(400, "You don't have 2FA enabled")
|
||||||
return render_template("login/lost_2fa.html", v=v)
|
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")
|
@limiter.limit("1/second;6/minute;200/hour;1000/day")
|
||||||
def request_2fa_disable():
|
def lost_2fa_post():
|
||||||
username=request.values.get("username")
|
username=request.values.get("username")
|
||||||
user=get_user(username, graceful=True)
|
user=get_user(username, graceful=True)
|
||||||
if not user or not user.email or not user.mfa_secret:
|
if not user or not user.email or not user.mfa_secret:
|
||||||
|
|
|
@ -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 authtext %}If all information is correct, you will be able to remove 2-factor authentication from your account in 24 hours.{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="login-form">
|
<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>
|
<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 %}>
|
<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>
|
<label for="email" class="mt-3">Password</label>
|
||||||
|
|
Loading…
Reference in New Issue