Compare commits

..

2 Commits
v1.0.4 ... v1.1

Author SHA1 Message Date
Mohamed El-Kalioby
8fe3d4e496 Fixed Redirections, Removed the need for FIDO2_LOGIN_URL 2019-01-25 14:56:06 +03:00
Mohamed El-Kalioby
263a5e2b8c Fixing Setup file 2019-01-25 14:50:40 +03:00
3 changed files with 5 additions and 4 deletions

View File

@@ -60,6 +60,8 @@ Depends on
* Trusted_Devices * Trusted_Devices
* Email * Email
**Note**: Starting version 1.1, ~~FIDO_LOGIN_URL~~ isn't required for FIDO2 anymore.
1. Break your login function 1. 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 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

View File

@@ -112,6 +112,6 @@ def authenticate_complete(request):
mfa["next_check"] = int((datetime.datetime.now()+ datetime.timedelta( mfa["next_check"] = int((datetime.datetime.now()+ datetime.timedelta(
seconds=random.randint(settings.MFA_RECHECK_MIN, settings.MFA_RECHECK_MAX))).strftime("%s")) seconds=random.randint(settings.MFA_RECHECK_MIN, settings.MFA_RECHECK_MAX))).strftime("%s"))
request.session["mfa"] = mfa request.session["mfa"] = mfa
login(request) res=login(request)
return HttpResponse(simplejson.dumps({'status':"OK","redirect":settings.FIDO_LOGIN_URL}),content_type="application/json") return HttpResponse(simplejson.dumps({'status':"OK","redirect":res["location"]}),content_type="application/json")
return HttpResponse(simplejson.dumps({'status': "err"}),content_type="application/json") return HttpResponse(simplejson.dumps({'status': "err"}),content_type="application/json")

View File

@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
setup( setup(
name='django-mfa2', name='django-mfa2',
version='1.0.4', version='1.1',
description='Allows user to add 2FA to their accounts', description='Allows user to add 2FA to their accounts',
long_description=open("README.md").read(), long_description=open("README.md").read(),
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
@@ -12,7 +12,6 @@ setup(
author='Mohamed El-Kalioby', author='Mohamed El-Kalioby',
author_email = 'mkalioby@mkalioby.com', author_email = 'mkalioby@mkalioby.com',
url = 'https://github.com/mkalioby/django-mfa2/', url = 'https://github.com/mkalioby/django-mfa2/',
long_description=open('README.md').read(),
download_url='https://github.com/mkalioby/django-mfa2/', download_url='https://github.com/mkalioby/django-mfa2/',
license='MIT', license='MIT',
packages=find_packages(), packages=find_packages(),