remote_billing: Make "plan management" always available.

Just shows a config error page if the bouncer is not enabled. Uses a new
endpoint for this so that it can work nicely for both browser and
desktop app clients.
It's necessary, because the desktop app expects to get a json response
with either an error or billing_access_url to redirect to. Showing a
nice config error page can't be done via the json error mechanism, so
instead we just serve a redirect to the new error page, which the app
will open in the browser in a new window or tab.
This commit is contained in:
Mateusz Mandera
2024-02-28 20:03:34 +01:00
committed by Tim Abbott
parent d5fb3f3176
commit e39f400f94
7 changed files with 115 additions and 18 deletions

View File

@@ -99,6 +99,7 @@ from zerver.views.push_notifications import (
remove_android_reg_id,
remove_apns_device_token,
self_hosting_auth_json_endpoint,
self_hosting_auth_not_configured,
self_hosting_auth_redirect_endpoint,
send_test_push_notification_api,
)
@@ -828,6 +829,10 @@ urls += [
self_hosting_auth_redirect_endpoint,
name="self_hosting_auth_redirect_endpoint",
),
path(
"self-hosted-billing/not-configured/",
self_hosting_auth_not_configured,
),
rest_path(
"json/self-hosted-billing",
GET=self_hosting_auth_json_endpoint,