mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
backend-auth: Add user ID to fetch api key responses.
Adds the user ID to the return values for the `/fetch_api_key` and `/dev_fetch_api_key` endpoints. This saves clients like mobile a round trip to the server to get the user's unique ID as it is now returned as part of the log in flow. Fixes #24980.
This commit is contained in:
committed by
Tim Abbott
parent
52f7eb4463
commit
e95b784f6e
@@ -1000,7 +1000,10 @@ def api_fetch_api_key(
|
||||
|
||||
api_key = process_api_key_fetch_authenticate_result(request, user_profile)
|
||||
|
||||
return json_success(request, data={"api_key": api_key, "email": user_profile.delivery_email})
|
||||
return json_success(
|
||||
request,
|
||||
data={"api_key": api_key, "email": user_profile.delivery_email, "user_id": user_profile.id},
|
||||
)
|
||||
|
||||
|
||||
def get_auth_backends_data(request: HttpRequest) -> Dict[str, Any]:
|
||||
|
||||
Reference in New Issue
Block a user