From 9d1063d3623ef47ec94effea0854ba24ae9237df Mon Sep 17 00:00:00 2001 From: Alena Volkova Date: Fri, 5 Jan 2018 15:30:55 -0500 Subject: [PATCH] urls: Move the json/fetch_api_key endpoint to be an API-style route. --- zerver/views/auth.py | 1 - zproject/legacy_urls.py | 2 -- zproject/urls.py | 6 ++++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/zerver/views/auth.py b/zerver/views/auth.py index 0222b0c16fac2..458a59005a52e 100644 --- a/zerver/views/auth.py +++ b/zerver/views/auth.py @@ -731,7 +731,6 @@ def api_get_server_settings(request: HttpRequest) -> HttpResponse: result[settings_item] = context[settings_item] return json_success(result) -@authenticated_json_post_view @has_request_variables def json_fetch_api_key(request: HttpRequest, user_profile: UserProfile, password: str=REQ(default='')) -> HttpResponse: diff --git a/zproject/legacy_urls.py b/zproject/legacy_urls.py index f29d89ae0bd49..51e29a6be5153 100644 --- a/zproject/legacy_urls.py +++ b/zproject/legacy_urls.py @@ -16,6 +16,4 @@ # any more to find out about subscriptions, since they are already # pushed to us via the event system. url(r'^json/subscriptions/exists$', zerver.views.streams.json_stream_exists), - - url(r'^json/fetch_api_key$', zerver.views.auth.json_fetch_api_key), ] diff --git a/zproject/urls.py b/zproject/urls.py index 636cdc6ddba1d..0bcf7a8128ad4 100644 --- a/zproject/urls.py +++ b/zproject/urls.py @@ -517,6 +517,12 @@ urls.append(url(r'^api/v1/external/github', github_dispatcher.api_github_webhook_dispatch)) +# Desktop-specific authentication URLs +urls += [ + url(r'^json/fetch_api_key$', rest_dispatch, + {'POST': 'zerver.views.auth.json_fetch_api_key'}), +] + # Mobile-specific authentication URLs urls += [ # This json format view used by the mobile apps lists which