Skip to content

Commit

Permalink
Added extra info to /accounts/token endpoint (#144)
Browse files Browse the repository at this point in the history
Added client_id and user_id to the returned responses for accounts/token
endpoint, which is needed by the gateway resolver service for logging
purposes.
  • Loading branch information
marblestation committed Apr 10, 2018
1 parent c2b8ac1 commit 40760fb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions adsws/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ def get(self):
)
return {'message': 'no ADS API token found'}, 500

return print_token(token)
output = print_token(token)
output['client_id'] = client.client_id
output['user_id'] = current_user.get_id()
return output

def put(self):
"""
Expand Down Expand Up @@ -305,7 +308,11 @@ def put(self):
current_app.logger.info(
"Updated ADS API token for {0}".format(current_user.email)
)
return print_token(token)

output = print_token(token)
output['client_id'] = client.client_id
output['user_id'] = current_user.get_id()
return output


class LogoutView(Resource):
Expand Down

0 comments on commit 40760fb

Please sign in to comment.