Include email in response to API key retrieval

This helps our iOS app when authenticating via Google Apps, since we
don't get the users' email address when we get the ID token from Google.

(imported from commit 066639958c1e8f7845505ebdabc37282defca5c5)
This commit is contained in:
Luke Faraone
2014-01-31 13:50:19 -05:00
parent 3263d09939
commit 9a1159fb09

View File

@@ -1591,7 +1591,7 @@ def api_fetch_api_key(request, username=REQ, password=REQ):
return json_error("Your username or password is incorrect.", data={"reason": "incorrect_creds"}, status=403)
if not user_profile.is_active:
return json_error("Your account has been disabled.", data={"reason": "disabled"}, status=403)
return json_success({"api_key": user_profile.api_key})
return json_success({"api_key": user_profile.api_key, "email": user_profile.email})
@authenticated_json_post_view
@has_request_variables