[hotfix][web] add config["base-dir"] to work in subdirs
This commit is contained in:
parent
a0254de86c
commit
1f32bf4267
2 changed files with 3 additions and 2 deletions
|
@ -205,6 +205,7 @@ def auth_required():
|
|||
@wraps(f)
|
||||
def decorated(*args, **kwargs):
|
||||
if not "login" in session:
|
||||
request_url = f"{config['base-dir']}{request.url}".replace("//", "/")
|
||||
return redirect(f"{config['base-dir']}login?return={request.url}")
|
||||
else:
|
||||
return f(*args, **kwargs)
|
||||
|
@ -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"])
|
||||
|
|
|
@ -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