diff --git a/authentic2/src/authentic2_auf/urls.py b/authentic2/src/authentic2_auf/urls.py index 9f9e971..d074665 100644 --- a/authentic2/src/authentic2_auf/urls.py +++ b/authentic2/src/authentic2_auf/urls.py @@ -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'), ) ) diff --git a/authentic2/src/authentic2_auf/views.py b/authentic2/src/authentic2_auf/views.py index 6ced003..fc5a192 100644 --- a/authentic2/src/authentic2_auf/views.py +++ b/authentic2/src/authentic2_auf/views.py @@ -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') +