mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-12 02:28:20 +02:00
Ensure all requests from the page sso go through the page sso.
This commit is contained in:
parent
5232bd38fd
commit
48764f0400
@ -38,7 +38,7 @@
|
|||||||
<span class="badge badge-primary navbar-badge">{{ session['language'] }}</span></a>
|
<span class="badge badge-primary navbar-badge">{{ session['language'] }}</span></a>
|
||||||
<div class="dropdown-menu dropdown-menu-right p-0" id="mailu-languages">
|
<div class="dropdown-menu dropdown-menu-right p-0" id="mailu-languages">
|
||||||
{%- for locale in config.translations.values() %}
|
{%- 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 %}
|
{%- endfor %}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
'base'
|
'base', 'languages'
|
||||||
]
|
]
|
||||||
|
9
core/admin/mailu/sso/views/languages.py
Normal file
9
core/admin/mailu/sso/views/languages.py
Normal file
@ -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;
|
proxy_pass http://$admin;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ^~ /ui/language {
|
|
||||||
include /etc/nginx/proxy.conf;
|
|
||||||
proxy_pass http://$admin;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ^~ /static {
|
location ^~ /static {
|
||||||
include /etc/nginx/proxy.conf;
|
include /etc/nginx/proxy.conf;
|
||||||
rewrite ^/static/(.*) /static/static/$1 break;
|
rewrite ^/static/(.*) /static/static/$1 break;
|
||||||
|
Loading…
Reference in New Issue
Block a user