Implémente la vue de login avec questions secrètes
This commit is contained in:
parent
2821ba4443
commit
a82f825a45
|
@ -3,12 +3,14 @@ from django.conf.urls import patterns, url
|
|||
from authentic2.decorators import setting_enabled, required
|
||||
|
||||
from . import app_settings
|
||||
from .views import index
|
||||
from .views import lost_password_login, secret_questions
|
||||
|
||||
urlpatterns = required(
|
||||
setting_enabled('ENABLE', settings=app_settings),
|
||||
patterns('',
|
||||
url('^authentic2_auf/$', index,
|
||||
name='authentic2-auf-index'),
|
||||
url('^accounts/auf/lost-password/$', lost_password_login,
|
||||
name='authentic2-auf-lost-password'),
|
||||
url('^accounts/auf/secret-questions/$', secret_questions,
|
||||
name='authentic2-auf-secret-questions'),
|
||||
)
|
||||
)
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
from django.shortcuts import render
|
||||
from auth.django.secretquestions.decorators import secret_questions_required
|
||||
from auth.django.secretquestions.views import secret_questions
|
||||
from django.contrib.auth import authenticate
|
||||
|
||||
|
||||
from authentic2.utils import login
|
||||
from . import decorators
|
||||
|
||||
__ALL_ = [ 'sso' ]
|
||||
|
||||
@decorators.plugin_enabled
|
||||
def index(request):
|
||||
return render(request, 'authentic2_auf/index.html')
|
||||
@secret_questions_required(60)
|
||||
def lost_password_login(request)
|
||||
user = authenticate(user=request.user)
|
||||
return login(request, user, 'secret-questions')
|
||||
|
||||
|
|
Reference in New Issue