mirror of https://github.com/zulip/zulip.git
fetch_api_key: Return `email` in json_response.
`/api/v1/fetch_api_key`'s response had a key `email` with the user's delivery email. But its JSON counterpart `/json/fetch_api_key`, which has a completely different implementation, did not return `email` in its success response. So to avoid confusion, the non-API endpoint, `/json/fetch_api_key` response has been made identical with it's `/api` counterpart by adding the `email` key. Also it is safe to send as the calling user will only see their own email.
This commit is contained in:
parent
2dd1ccef15
commit
8ab6182683
|
@ -4794,6 +4794,7 @@ components:
|
|||
- $ref: '#/components/schemas/JsonSuccess'
|
||||
- required:
|
||||
- api_key
|
||||
- email
|
||||
- properties:
|
||||
api_key:
|
||||
type: string
|
||||
|
|
|
@ -946,7 +946,7 @@ def json_fetch_api_key(request: HttpRequest, user_profile: UserProfile,
|
|||
return json_error(_("Your username or password is incorrect."))
|
||||
|
||||
api_key = get_api_key(user_profile)
|
||||
return json_success({"api_key": api_key})
|
||||
return json_success({"api_key": api_key, "email": user_profile.delivery_email})
|
||||
|
||||
@csrf_exempt
|
||||
def api_fetch_google_client_id(request: HttpRequest) -> HttpResponse:
|
||||
|
|
Loading…
Reference in New Issue