Eos/eosweb/core/templates/auth/login.html

55 lines
1.9 KiB
HTML

{% extends 'base.html' %}
{#
Eos - Verifiable elections
Copyright © 2017 RunasSudo (Yingtong Li)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% block title %}Log in{% endblock %}
{% block content %}
{% if session.user %}
<p>You are currently logged in as {{ session.user.name }}. Please select an option from the list below to switch accounts.</p>
{% else %}
<p>You are not currently logged in. Please select an option from the list below to log in.</p>
{% endif %}
<ul class="ui list">
{% for auth_method in eosweb.app.config['AUTH_METHODS'] %}
<li><a href="/auth/{{ auth_method[0] }}/login" target="_blank" onclick="login(this);return false;">{{ auth_method[1] }}</a></li>
{% endfor %}
</ul>
<div class="ui hidden error message">
<div class="header">Error logging in</div>
<p>Your log in details appear to be correct, however there was an unknown error while logging you in.</p>
<p>Please try again. If the problem persists, contact your election administrator.</p>
</div>
{% endblock %}
{% block basecontent %}
{{ super() }}
<script>
function login(el) {
window.open(el.getAttribute("href"), "eos_login_window", "width=400,height=600");
}
function callback_complete() {
window.location = "{{ url_for('login_callback') }}";
return true;
}
</script>
{% endblock %}