Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable two-factor authentication. #222

Open
wants to merge 1 commit into
base: next_release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 0 additions & 118 deletions angelman/angelman/templates/admin/login.html

This file was deleted.

89 changes: 89 additions & 0 deletions angelman/angelman/templates/two_factor/core/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{% extends "two_factor/_base_focus.html" %}

{% load i18n static two_factor %}

{% block content %}
<form action="" method="post">
{% csrf_token %}

<div class="panel panel-default">
<div class="panel-heading">Login</div>
<div class="panel-body">
<div class="row">
{% if wizard.steps.current == 'auth' %}
<div class="col-xs-12">
<div class="alert alert-warning">
<p>Please enter your e-mail address and the password you chose when you registered.</p>
<p>If you haven't got a user account yet, you can create one by going to <a href="https://angelmanregistry.info/">https://angelmanregistry.info</a> and clicking 'Register Now'.</p>
<p>If you have forgotten your password, please click on 'Trouble signing in?'</p>
</div>
</div>
{% elif wizard.steps.current == 'token' %}
<div class="col-xs-12 text-center">
{% blocktrans %}Please enter the token generated by your token generator.{% endblocktrans %}
</div>
{% endif %}
</div>

{% if form.non_field_errors %}
<div class="row">
<div class="col-xs-12">
<div class="alert alert-danger" role="alert">
<div class="alert-text"></div>
<div class="row">
{% if form.non_field_errors|length > 1 %}
<ul>
{% for err in form.non_field_errors %}
<li>{{ err }}</li>
{% endfor %}
</ul>
{% else %}
{% for err in form.non_field_errors %}
<div class="text-center">{{ err }}</div>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}

{% if wizard.steps.current == 'auth' %}
<input type="hidden" name="login_view-current_step" value="auth" id="id_login_view-current_step">

<div class="form-group">
<label for="id_auth-username">{{ form.username.label }}:</label>
<input type="text" name="auth-username" class="form-control" autofocus="autofocus" value="{{ form.username.value|default:"" }}"maxlength="254" required="required" id="id_auth-username">
</div>
<div class="form-group">
<label for="id_auth-password">{{ form.password.label }}:</label>
<input type="password" name="auth-password" class="form-control" value="{{ form.password.value|default:"" }}" required="required" id="id_auth-password">
</div>
{% elif wizard.steps.current == 'token' %}
<input type="hidden" name="login_view-current_step" value="token" id="id_login_view-current_step">
<div class="form-group">
<label for="id_token-otp_token">Token:</label>
<input type="number" name="token-otp_token" class="form-control" autofocus="autofocus" value="{{ form.otp_token.value|default:"" }}" min="1" max="99999999" id="id_token-otp_token">
</div>
{% else %}
{% include "two_factor/_wizard_forms.html" %}
{% endif %}

{# hidden submit button to enable [enter] key #}
<div style="display: none"><input type="submit" value=""/></div>

<div class="row">
<div class="col-sm-12">
{% include "two_factor/_wizard_actions.html" %}
</div>
</div>
</div>

<div class="panel-footer">
<a href="{% url 'login_assistance' %}">{% trans "Trouble signing in?" %}</a>
<div class="clearfix"></div>
</div>

</form>

{% endblock %}
2 changes: 1 addition & 1 deletion rdrf