Still building initial conversions
This commit is contained in:
parent
cea56d2868
commit
3cfd9840e8
23 changed files with 2925 additions and 21 deletions
27
sqrl/templates/sqrl/login.html
Normal file
27
sqrl/templates/sqrl/login.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
{% extends "sqrl/sqrl_base.html" %}
|
||||
{% load sqrl %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Log in via SQRL{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Log in</h1>
|
||||
|
||||
<p>
|
||||
Please use via SQRL using the information below.
|
||||
</p>
|
||||
|
||||
{% sqrl as session_sqrl %}
|
||||
{% sqrl_login_dropin session_sqrl %}
|
||||
{% endblock %}
|
||||
|
||||
{% comment %}
|
||||
**sqrl/login.html**
|
||||
This is SQRL-only login page.
|
||||
No special variables are passed in the context for the login to work.
|
||||
All necessary data should already be in the context.
|
||||
|
||||
Please note again that this template is for SQRL-exclusive logins.
|
||||
If you would like to add SQRL login to an existing login page,
|
||||
you should rather adjust that template as it is probably way more involved.
|
||||
{% endcomment %}
|
54
sqrl/templates/sqrl/manage.html
Normal file
54
sqrl/templates/sqrl/manage.html
Normal file
|
@ -0,0 +1,54 @@
|
|||
{% extends "sqrl/sqrl_base.html" %}
|
||||
{% load sqrl %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Manage SQRL Identity{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Manage SQRL Identity with your account</h1>
|
||||
|
||||
{% if not user.sqrl_identity %}
|
||||
<p>
|
||||
You dont have SQRL identity associated with your account yet.
|
||||
Please use SQRL link/QR code below to associate SQRL identity with your account.
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
Congratulations! You already have SQRL identity associated with your account.
|
||||
If you would like to either change or delete existing SQRL identity
|
||||
associated with your account, you can do that by selecting appropriate
|
||||
option in your SQRL client and then using the SQRL link/QR code below.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Note:</strong> For both changing or deleting your SQRL identity,
|
||||
you will need to load your SQRL rescue code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Caution:</strong> Normally it is not advised to change or delete
|
||||
your SQRL identity. Usually these operations are only required when
|
||||
SQRL identity is compromised.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% sqrl as session_sqrl %}
|
||||
{% sqrl_login_dropin session_sqrl method="manage" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{% static 'sqrl/sqrl.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% comment %}
|
||||
**sqrl/manage.html**
|
||||
Used to manage SQRL identity in relation to existing logged in account.
|
||||
When no SQRL identity is already associated with the account,
|
||||
it can be used to associate a new identity.
|
||||
When existing SQRL is already associated, this page can be used
|
||||
to either change or delete existing identity.
|
||||
|
||||
No special variables are passed in the context for the association
|
||||
to work. All necessary data should already be in the context.
|
||||
{% endcomment %}
|
30
sqrl/templates/sqrl/register.html
Normal file
30
sqrl/templates/sqrl/register.html
Normal file
|
@ -0,0 +1,30 @@
|
|||
{% extends "sqrl/sqrl_base.html" %}
|
||||
|
||||
{% block title %}Complete User Tegistration{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Complete User Registration</h1>
|
||||
|
||||
<p>
|
||||
Already have account?
|
||||
Login <a href="{% url 'login' %}">here</a> to associate
|
||||
SQRL identity with existing account.
|
||||
</p>
|
||||
|
||||
<form method="post">
|
||||
{{ form.as_p }}
|
||||
<input type="submit">
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{% comment %}
|
||||
**sqrl/register.html**
|
||||
Used to complete user registration. This template is used when user is trying to login
|
||||
with SQRL however does not already have that SQRL identity associated with any
|
||||
existing account. Since SQRL does not provide any additional information other then
|
||||
SQRL identity itslef, we need to collect some additinal information from the user
|
||||
such as username. All the relevant information is collected via form.
|
||||
|
||||
No special variables are passed in the context.
|
||||
All necessary data should already be in the context.
|
||||
{% endcomment %}
|
41
sqrl/templates/sqrl/sqrl-dropin.html
Normal file
41
sqrl/templates/sqrl/sqrl-dropin.html
Normal file
|
@ -0,0 +1,41 @@
|
|||
{% load static %}
|
||||
{% load sqrl %}
|
||||
<style>
|
||||
.sqrl-wrap {
|
||||
padding: 15px;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
max-width: 300px;
|
||||
border-radius: 5%;
|
||||
}
|
||||
#sqrl-id img {
|
||||
margin: auto;
|
||||
width: 100%;
|
||||
padding-top: 3px;
|
||||
}
|
||||
.sqrl-wrap a {
|
||||
font-size: 50%;
|
||||
}
|
||||
</style>
|
||||
<div>
|
||||
<form method="get" action="{{ session_sqrl.sqrl_url }}">
|
||||
<div class="sqrl-wrap">
|
||||
SQRL Login
|
||||
<a href="{{ session_sqrl.sqrl_url }}">
|
||||
<div id="sqrl-qr" data-sqrl="{{ session_sqrl.sqrl_url }}"></div>
|
||||
</a>
|
||||
<a href="https://www.grc.com/sqrl/sqrl.htm">What is SQRL?</a>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="nut" value="{{ session_sqrl.nut.nonce }}">
|
||||
{% if session_sqrl.method == "manage" %}
|
||||
{# redirect to manage page after successful SQRL transaction #}
|
||||
<input type="hidden" name="next" value="{% url 'sqrl:manage' %}">
|
||||
<input type="submit" value="Manage SQRL">
|
||||
{% else %}
|
||||
<input type="submit" value="Log in using SQRL">
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
{% sqrl_status_url_script_tag session_sqrl %}
|
||||
<script src="{% static sqrl/sqrl.js %}"></script>
|
1
sqrl/templates/sqrl/sqrl_base.html
Normal file
1
sqrl/templates/sqrl/sqrl_base.html
Normal file
|
@ -0,0 +1 @@
|
|||
{% extends "base.html" %}
|
Loading…
Add table
Add a link
Reference in a new issue