Commit 8fbf5367 authored by root's avatar root
Browse files

Fix prepare response function.

parent 63ecdd20
......@@ -124,7 +124,7 @@ def get_invitation(request):
pass
return invitation
def prepare_response(request, user, next='', renew=False, skip_login=False):
def prepare_response(request, user, next='', renew=False):
"""Return the unique username and the token
as 'X-Auth-User' and 'X-Auth-Token' headers,
or redirect to the URL provided in 'next'
......@@ -141,13 +141,6 @@ def prepare_response(request, user, next='', renew=False, skip_login=False):
user.renew_token()
user.save()
if next:
# TODO: Avoid redirect loops.
parts = list(urlsplit(next))
if not parts[1] or (parts[1] and request.get_host() != parts[1]):
parts[3] = urlencode({'user': user.email, 'token': user.auth_token})
next = urlunsplit(parts)
if settings.FORCE_PROFILE_UPDATE and not user.is_verified and not user.is_superuser:
params = ''
if next:
......@@ -156,7 +149,6 @@ def prepare_response(request, user, next='', renew=False, skip_login=False):
response = HttpResponse()
if not skip_login:
# authenticate before login
user = authenticate(email=user.email, auth_token=user.auth_token)
login(request, user)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment