X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=auth%2Fviews.py;h=45fe637823939d3283801414bf4bd42416508a35;hb=bbdf40b4dd1bebc81461f1c9294aca95323bf889;hp=d1e78b5373b9e2ef38087a9170e8e35355bb2f93;hpb=f72be702471054ae1469c293458b0adb1605418d;p=unfold.git diff --git a/auth/views.py b/auth/views.py index d1e78b53..45fe6378 100644 --- a/auth/views.py +++ b/auth/views.py @@ -8,17 +8,23 @@ from django.http import HttpResponseRedirect from auth.backend import MyCustomBackend from myslice.viewutils import the_user +from myslice.config import Config def login_user(request): state = "Please log in below..." username = password = '' - env={'hard_wired_users':MyCustomBackend.hard_wired_users} - + env={'hard_wired_users':MyCustomBackend.hard_wired_users, + 'manifold_url':Config.manifold_url(), + } + if request.POST: username = request.POST.get('username') password = request.POST.get('password') + + # pass request within the token, so manifold session key could be attached to the request session. + token = {'username': username, 'password': password, 'request': request} - user = authenticate(username=username, password=password) + user = authenticate(token=token) if user is not None: if user.is_active: login(request, user)