Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apigateway/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,10 +1408,15 @@ def _register_hooks(self, app: Flask):
@app.after_request
def _after_request_hook(response: Response):
if self._producer is not None:
try:
real_user = current_user._get_current_object()
except:
current_app.logger.exception("Unable to collect real user. Most likely due to unbound session.")
return response
self._producer.send(
self.get_service_config("REQUEST_TOPIC"),
{
"user_id": current_user.get_id(),
"user_id": real_user.get_id(),
"client_id": (
current_token.client_id
if current_token and hasattr(current_token, "client")
Expand Down