Commit 230e33e9 authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

prepare response set user email instead of username

parent fc3da598
......@@ -18,7 +18,7 @@
<thead>
<tr>
<th>ID</th>
<th>Username</th>
<th>Email</th>
<th>Real Name</th>
<th>Code</th>
<th>Inviter username</th>
......@@ -32,7 +32,7 @@
{% for inv in invitations %}
<tr>
<td>{{ inv.id }}</td>
<td>{{ inv.username }}</td>
<td>{{ inv.email }}</td>
<td>{{ inv.realname }}</td>
<td>{{ inv.code }}</td>
<td>{{ inv.inviter.username }}</td>
......
......@@ -63,7 +63,7 @@ def prepare_response(request, user, next='', renew=False, skip_login=False):
# 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.username, 'token': user.auth_token})
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:
......@@ -78,9 +78,9 @@ def prepare_response(request, user, next='', renew=False, skip_login=False):
response = HttpResponse()
if not next:
response['X-Auth-User'] = user.username
response['X-Auth-User'] = user.email
response['X-Auth-Token'] = user.auth_token
response.content = user.username + '\n' + user.auth_token + '\n'
response.content = user.email + '\n' + user.auth_token + '\n'
response.status_code = 200
else:
response['Location'] = next
......
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