Ensure all requests from the page sso go through the page sso.

master
Dimitri Huisman 3 years ago
parent 5232bd38fd
commit 48764f0400

@ -38,7 +38,7 @@
<span class="badge badge-primary navbar-badge">{{ session['language'] }}</span></a>
<div class="dropdown-menu dropdown-menu-right p-0" id="mailu-languages">
{%- for locale in config.translations.values() %}
<a class="dropdown-item{% if locale.language == session['language'] %} active{% endif %}" href="{{ url_for('ui.set_language', language=locale.language) }}">{{ locale.get_language_name().title() }}</a>
<a class="dropdown-item{% if locale.language == session['language'] %} active{% endif %}" href="{{ url_for('sso.set_language', language=locale.language) }}">{{ locale.get_language_name().title() }}</a>
{%- endfor %}
</div>
</li>

@ -1,3 +1,3 @@
__all__ = [
'base'
'base', 'languages'
]

@ -0,0 +1,9 @@
from mailu.sso import sso, forms
from mailu.ui import access
import flask
@sso.route('/language/<language>', methods=['POST'])
def set_language(language=None):
flask.session['language'] = language
return flask.Response(status=200)

@ -134,11 +134,6 @@ http {
proxy_pass http://$admin;
}
location ^~ /ui/language {
include /etc/nginx/proxy.conf;
proxy_pass http://$admin;
}
location ^~ /static {
include /etc/nginx/proxy.conf;
rewrite ^/static/(.*) /static/static/$1 break;

Loading…
Cancel
Save