Commit 877e7c5b authored by ale's avatar ale

Remove obsolete Jinja2 filters

No need to force the 'escape' filter, autoescaping is on.
parent ae145f2b
......@@ -62,6 +62,7 @@ def show_login_page(params, err=None):
destination=params.destination,
groups=params.groups or [],
csrf_token=csrf_token,
enable_otp=app.login_service.enable_otp,
err=err)
......@@ -80,12 +81,11 @@ def login():
# Extract local auth cookie if present. If not, show the login
# form.
local_ticket = None
local_ticket_str = request.cookies.get(SSO_COOKIE_NAME)
if local_ticket_str:
local_ticket = app.login_service.local_authorize(
_tostr(local_ticket_str))
else:
local_ticket = None
if request.method == 'GET':
# Check local authentication.
......@@ -104,7 +104,7 @@ def login():
username = _tostr(request.form.get('username'))
password = _tostr(request.form.get('password'))
otp = None
if app.config.get('SSO_ENABLE_OTP'):
if app.login_service.enable_otp:
otp = _tostr(request.form.get('otp'))
if not app.login_service.authenticate(username, password, otp):
app.logger.error(
......
......@@ -20,7 +20,7 @@
<div id="container" class="pure-g-r">
<div class="pure-u">
<h1>{{ config['HTML_BANNER'] }}</h1>
<h1>{{ config['HTML_BANNER'] | safe }}</h1>
{% block content %}{% endblock %}
</div>
......
......@@ -22,18 +22,18 @@ function setFocus() {
{% block body_attrs %}onload="setFocus();"{% endblock %}
{% block content %}
<p>Single Sign-On for {{ service | e }}</p>
<p>Single Sign-On for {{ service }}</p>
<form action="{{ url_for('login') }}" method="post" autocomplete="off"
class="pure-form pure-form-aligned">
<input type="hidden" name="_csrf" value="{{ csrf_token }}">
<input type="hidden" name="s" value="{{ service | e }}">
<input type="hidden" name="d" value="{{ destination | e }}">
<input type="hidden" name="g" value="{{ ','.join(groups) | e }}">
<input type="hidden" name="s" value="{{ service }}">
<input type="hidden" name="d" value="{{ destination }}">
<input type="hidden" name="g" value="{{ ','.join(groups) }}">
<div class="pure-control-group">
<label for="username">Username:</label>
<input type="text" id="username" name="username" value="{{ username | e }}">
<input type="text" id="username" name="username" value="{{ username }}">
</div>
<div class="pure-control-group">
......@@ -41,7 +41,7 @@ function setFocus() {
<input type="password" id="password" name="password">
</div>
{%- if config.get('SSO_ENABLE_OTP') %}
{%- if enable_otp %}
<div class="pure-control-group">
<label for="otp">OTP:</label>
<input type="text" id="otp" name="otp" size="6">
......
......@@ -9,7 +9,7 @@
<table>
{% for s in services %}
<tr>
<td><tt>{{ s | e }}</tt></td>
<td><tt>{{ s }}</tt></td>
<td><iframe style="width:80px;height:35px;border:0;"
src="https://{{ s }}sso_logout">loading...</iframe></td>
</tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment