forked from Github-Mirrors/canaille
Authorization screen do not display menu
This commit is contained in:
parent
de1d0a232d
commit
8d48e4bdd7
4 changed files with 8 additions and 5 deletions
|
@ -56,6 +56,7 @@ def setup_app(app):
|
|||
"logo_url": app.config.get("LOGO"),
|
||||
"website_name": app.config.get("NAME"),
|
||||
"user": current_user(),
|
||||
"menu": True,
|
||||
}
|
||||
|
||||
@babel.localeselector
|
||||
|
|
|
@ -29,7 +29,7 @@ def admin_needed():
|
|||
user = current_user()
|
||||
if not user:
|
||||
abort(403)
|
||||
if not user.is_admin:
|
||||
if not user.admin:
|
||||
abort(404)
|
||||
return view_function(*args, **kwargs)
|
||||
|
||||
|
|
|
@ -19,11 +19,11 @@ def authorize():
|
|||
if not user:
|
||||
form = LoginForm(request.form or None)
|
||||
if request.method == "GET":
|
||||
return render_template("login.html", form=form)
|
||||
return render_template("login.html", form=form, menu=False)
|
||||
|
||||
if not form.validate() or not User.login(form.login.data, form.password.data):
|
||||
flash(gettext("Login failed, please check your information"), "error")
|
||||
return render_template("login.html", form=form)
|
||||
return render_template("login.html", form=form, menu=False)
|
||||
|
||||
return redirect(request.url)
|
||||
|
||||
|
@ -33,7 +33,9 @@ def authorize():
|
|||
except OAuth2Error as error:
|
||||
return jsonify(dict(error.get_body()))
|
||||
|
||||
return render_template("authorize.html", user=user, grant=grant, client=client)
|
||||
return render_template(
|
||||
"authorize.html", user=user, grant=grant, client=client, menu=False
|
||||
)
|
||||
|
||||
if request.form["answer"] == "logout":
|
||||
del session["user_dn"]
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<body>
|
||||
<div class="container">
|
||||
{% block menu %}
|
||||
{% if user %}
|
||||
{% if user and menu %}
|
||||
<nav class="ui labeled icon menu">
|
||||
{% if logo_url %}
|
||||
<div class="header item">
|
||||
|
|
Loading…
Reference in a new issue