diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e8e2c6..69fe16f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log -## 2.2.1 +## 2.3.0 * Fixed: A missing import Thanks @AndreasDickow + * Fixed: `MFA.html` now call `{{block.super}}` for head and content blocks + * Added: #55 introduced `mfa_base.html` which will be extended by `MFA.html` for better styling ## 2.2.0 * Added: MFA_REDIRECT_AFTER_REGISTRATION settings parameter diff --git a/README.md b/README.md index e8710bb..2d98e3c 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,9 @@ Depends on 'mfa', '......') ``` -1. Collect Static Files +2. Collect Static Files `python manage.py collectstatic` -1. Add the following settings to your file +3. Add the following settings to your file ```python MFA_UNALLOWED_METHODS=() # Methods that shouldn't be allowed for the user @@ -95,7 +95,7 @@ Depends on * Starting version 1.7.0, Key owners can be specified. * Starting version 2.2.0 * Added: `MFA_SUCCESS_REGISTRATION_MSG` & `MFA_REDIRECT_AFTER_REGISTRATION` -1. Break your login function +4. Break your login function 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 @@ -115,7 +115,7 @@ Depends on return log_user_in(request,username=user.username) #log_user_in is a function that handles creatung user session, it should be in the setting file as MFA_CALLBACK ``` -1. Add mfa to urls.py +5. Add mfa to urls.py ```python import mfa import mfa.TrustedDevice @@ -126,13 +126,14 @@ Depends on '....', ] ``` -1. Provide `mfa_auth_base.html` in your templaes with block called 'head' and 'content' - The template will be included during the user login. +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. 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`. -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. -1. Somewhere in your app, add a link to 'mfa_home' +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. + **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` +8. Somewhere in your app, add a link to 'mfa_home' ```
  • Security
  • ``` + For Example, See 'example' app # Going Passwordless @@ -183,6 +184,7 @@ function some_func() { * [unramk](https://github.com/unramk) * [willingham](https://github.com/willingham) * [AndreasDickow](https://github.com/AndreasDickow) +* [mnelson4](https://github.com/mnelson4) # Security contact information diff --git a/example/example/templates/mfa_auth_base.html b/example/example/templates/mfa_auth_base.html index 5c54b02..cbdb026 100644 --- a/example/example/templates/mfa_auth_base.html +++ b/example/example/templates/mfa_auth_base.html @@ -28,6 +28,7 @@
    Login
    {% block content %} + {% endblock %}
    diff --git a/mfa/templates/MFA.html b/mfa/templates/MFA.html index e7510ea..ce435d8 100644 --- a/mfa/templates/MFA.html +++ b/mfa/templates/MFA.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "mfa_base.html" %} {% load static %} {% block head %} {{block.super}} diff --git a/mfa/templates/mfa_base.html b/mfa/templates/mfa_base.html new file mode 100644 index 0000000..4d4df3a --- /dev/null +++ b/mfa/templates/mfa_base.html @@ -0,0 +1,7 @@ +{% extends 'base.html' %} +{% block head %} +{{ block.super }} +{% endblock %} +{% block content %} +{{ block.super }} +{% endblock %} \ No newline at end of file diff --git a/setup.py b/setup.py index ae6cc81..be2d94f 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import find_packages, setup setup( name='django-mfa2', - version='2.2.0', + version='2.3.0', description='Allows user to add 2FA to their accounts', long_description=open("README.md").read(), long_description_content_type="text/markdown",