Skip to content

Commit

Permalink
[WebInterface] make forced login message clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Jan 14, 2025
1 parent b28b0fc commit e9fe53f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<br>
<div class="card text-center w-50 mx-auto">
<h2 class="card-header">Welcome to OctoBot's advanced interface</h2>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ 'danger' if category == 'error' else 'success' }}">
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="card-body py-4">
This interface is providing insights on some OctoBot advanced concepts and should be used once OctoBot basic
features are understood.
Expand Down
6 changes: 3 additions & 3 deletions Services/Interfaces/web_interface/login/web_login_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def active_login_required(func):
def decorated_view(*args, **kwargs):
if is_login_required():
return _login_required_func(func, *args, **kwargs)
flask.flash("For security reasons, please enable password authentication in "
"accounts configuration to use this page.",
flask.flash(f"For security reasons, please enable password authentication in "
f"accounts configuration to use the {flask.request.path} page.",
category=flask_login.LOGIN_MESSAGE_CATEGORY)
return flask.redirect(flask.current_app.login_manager.login_view)
return flask.redirect('home')
return decorated_view


Expand Down

0 comments on commit e9fe53f

Please sign in to comment.