[hotfix][web] add config["base-dir"] to work in subdirs
This commit is contained in:
parent
a0254de86c
commit
60d1eb4a1a
3 changed files with 5 additions and 4 deletions
|
@ -205,7 +205,8 @@ def auth_required():
|
|||
@wraps(f)
|
||||
def decorated(*args, **kwargs):
|
||||
if not "login" in session:
|
||||
return redirect(f"{config['base-dir']}login?return={request.url}")
|
||||
request_url = f"{config['base-dir']}{request.url}".replace("//", "/")
|
||||
return redirect(f"{config['base-dir']}login?return={request_url}")
|
||||
else:
|
||||
return f(*args, **kwargs)
|
||||
return decorated
|
||||
|
@ -243,7 +244,7 @@ def kioubit_auth():
|
|||
@app.route("/logout")
|
||||
def logout():
|
||||
session.clear()
|
||||
return redirect("/")
|
||||
return redirect(config["base-dir"])
|
||||
|
||||
|
||||
@app.route("/login", methods=["GET", "POST"])
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<a href="{{config['base-dir']}}logout">logout</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<a href="{{config['base-dir']}}login?return=/peerings">login</a>{%endif%}
|
||||
<a href="{{config['base-dir']}}login?return={{config['base-dir']}}peerings">login</a>{%endif%}
|
||||
</header>
|
||||
<div class="content flex">{% block content %} {% endblock %}</div>
|
||||
<footer class="flex">
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
type="hidden"
|
||||
id="return"
|
||||
name="return"
|
||||
value='{{config["domain"]+"/api/auth/kverify"}}'
|
||||
value='{{config["domain"]+config["base-dir"]+"api/auth/kverify"}}'
|
||||
/>
|
||||
<button
|
||||
type="submit"
|
||||
|
|
Loading…
Add table
Reference in a new issue