mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-06 21:54:47 +02:00

Add user security questions upon registration as extra authentication for password reset. Three unique security questions must be chosen and answered. Answers are then stored in the database with the same hashing algorithm as the users's password. On password reset, users get two chances to get two out of three security questions answered correctly. After a second failure their account is locked and email is sent to the admin. The same template is shown for the axes lockout. Super user cannot reset their password until they set security questions. Users can update their security questions or add them if they weren't originally set (in the case of super user) in Edit Profile. Signed-off-by: Amber Elliot <amber.n.elliot@intel.com>
26 lines
702 B
Python
26 lines
702 B
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.11.17 on 2019-01-03 01:25
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations
|
|
from layerindex.securityquestions import security_questions
|
|
|
|
|
|
def populate_security_questions(apps, schema_editor):
|
|
SecurityQuestion = apps.get_model('layerindex', 'SecurityQuestion')
|
|
|
|
for question in security_questions:
|
|
securityquestion = SecurityQuestion()
|
|
securityquestion.question = question
|
|
securityquestion.save()
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('layerindex', '0030_securityquestion'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(populate_security_questions),
|
|
]
|