Skip to content

Commit 85b4a25

Browse files
committed
v2.3.0 #done
1 parent 7415b16 commit 85b4a25

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Change Log
2-
## 2.2.1
2+
## 2.3.0
33
* Fixed: A missing import Thanks @AndreasDickow
4+
* Fixed: `MFA.html` now call `{{block.super}}` for head and content blocks
5+
* Added: #55 introduced `mfa_base.html` which will be extended by `MFA.html` for better styling
46

57
## 2.2.0
68
* Added: MFA_REDIRECT_AFTER_REGISTRATION settings parameter

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ Depends on
6060
'mfa',
6161
'......')
6262
```
63-
1. Collect Static Files
63+
2. Collect Static Files
6464
`python manage.py collectstatic`
65-
1. Add the following settings to your file
65+
3. Add the following settings to your file
6666

6767
```python
6868
MFA_UNALLOWED_METHODS=() # Methods that shouldn't be allowed for the user
@@ -95,7 +95,7 @@ Depends on
9595
* Starting version 1.7.0, Key owners can be specified.
9696
* Starting version 2.2.0
9797
* Added: `MFA_SUCCESS_REGISTRATION_MSG` & `MFA_REDIRECT_AFTER_REGISTRATION`
98-
1. Break your login function
98+
4. Break your login function
9999

100100
Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support mfa, this has to change
101101

@@ -115,7 +115,7 @@ Depends on
115115
return log_user_in(request,username=user.username)
116116
#log_user_in is a function that handles creatung user session, it should be in the setting file as MFA_CALLBACK
117117
```
118-
1. Add mfa to urls.py
118+
5. Add mfa to urls.py
119119
```python
120120
import mfa
121121
import mfa.TrustedDevice
@@ -126,13 +126,14 @@ Depends on
126126
'....',
127127
]
128128
```
129-
1. Provide `mfa_auth_base.html` in your templaes with block called 'head' and 'content'
130-
The template will be included during the user login.
129+
6. Provide `mfa_auth_base.html` in your templates with block called 'head' and 'content', The template will be included during the user login, the template shall be close to the login template.
131130
If you will use Email Token method, then you have to provide template named `mfa_email_token_template.html` that will content the format of the email with parameter named `user` and `otp`.
132-
1. To match the look and feel of your project, MFA includes `base.html` but it needs blocks named `head` & `content` to added its content to it.
133-
1. Somewhere in your app, add a link to 'mfa_home'
131+
7. To match the look and feel of your project, MFA includes `base.html` but it needs blocks named `head` & `content` to added its content to it.
132+
**Note:** Starting v2.3.0, a new template `mfa_base.html` is introduced, this template is used by `MFA.html` so you can control the styling better and current `mfa_base.html` extends `base.html`
133+
8. Somewhere in your app, add a link to 'mfa_home'
134134
```<li><a href="{% url 'mfa_home' %}">Security</a> </li>```
135135

136+
136137
For Example, See 'example' app
137138

138139
# Going Passwordless
@@ -183,6 +184,7 @@ function some_func() {
183184
* [unramk](https://github.com/unramk)
184185
* [willingham](https://github.com/willingham)
185186
* [AndreasDickow](https://github.com/AndreasDickow)
187+
* [mnelson4](https://github.com/mnelson4)
186188

187189

188190
# Security contact information

example/example/templates/mfa_auth_base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<div class="card-header">Login</div>
2929
<div class="card-body">
3030
{% block content %}
31+
3132
{% endblock %}
3233
</div>
3334
</div>

mfa/templates/MFA.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "base.html" %}
1+
{% extends "mfa_base.html" %}
22
{% load static %}
33
{% block head %}
44
{{block.super}}

mfa/templates/mfa_base.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends 'base.html' %}
2+
{% block head %}
3+
{{ block.super }}
4+
{% endblock %}
5+
{% block content %}
6+
{{ block.super }}
7+
{% endblock %}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name='django-mfa2',
7-
version='2.2.0',
7+
version='2.3.0',
88
description='Allows user to add 2FA to their accounts',
99
long_description=open("README.md").read(),
1010
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)