Source

django-twostepauth / exampleapp / demoapp / templates / twostepauth / profile.html

{% extends 'base.html' %}

{% block title %}Manage two-step authentication{% endblock %}

{% block content_title %}<h2>Account {{ profile.user.username }} - Manage Two-Step Authentication</h2>{% endblock %}

{% block content %}

<script>
$(document).ready( function() {
	$('a#backcode_toggle').click( function() {
		$('#backupcodes').toggle();
		return false;
	});	
});
</script>

<form action="" method="post" id="twostepauth_change_form">
  <fieldset>
	{% if not chart_url %}
     <p>With 2-Step authentication, the server will check first the username/email and password 
		and then will ask for an authentication token generated by the Authenticator App installed in 
		a mobile device (during 30 days logins from the same computer will not need the token). Using
		2-Step authentication will make the account more secure.</p>
	{% endif %}
    {% csrf_token %}
    {{ form.as_p }}
  </fieldset>
  {% if chart_url %}
  <p>
	<label>QR code to setup the authenticator app</label>
	<img src="{{ chart_url }}">
  </p>
  <p>
    <label>Secret Key</label>
    {{ profile.tsa_secret }}
  </p>
  <p>
	<label>Backup codes <br> &nbsp;</label>
	<a id="backcode_toggle" href="">Display/hide backup codes</a>
	<span id="backupcodes" style="display:none">
		<br>
		{% for code in profile.get_backup_codes %}
		  {{ code }} &nbsp;
		  {% if forloop.counter == 5 %}<br>{% endif %}
		{% endfor %}
	</span>
  </p>
  {% endif %}
  <p>
  <input type="submit" value="Change" />
  </p>
</form>

{% endblock %}