Skip to content

Commit 9b5487d

Browse files
BB2-3389: Serve openapi oauth2-redirect.html from server instead from static folder (#1243)
* BB2-3389: Serve openapi oauth2-redirect.html from server instead from static folder * Remove gpg key added by mistake
1 parent d03b121 commit 9b5487d

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed
File renamed without changes.

apps/docs/templates/openapi.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
return request;
6969
},
7070

71-
oauth2RedirectUrl: window.location.origin + "/static/oauth2-redirect.html"
71+
oauth2RedirectUrl: window.location.origin + "/docs/oauth2-redirect"
7272
});
7373

7474
window.ui = ui;

apps/docs/urls.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from django.urls import path
22
from .views import openapi
3+
from .views import openapi_oauth2_redirect
34

45
urlpatterns = [
56
path("openapi", openapi, name="bluebutton_openapi"),
7+
path("oauth2-redirect", openapi_oauth2_redirect, name="oauth2-redirect"),
68
]

apps/docs/views.py

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from waffle import switch_is_active
44

55
OPENAPI_PAGE = "openapi.html"
6+
OPENAPI_OAUTH2_REDIRECT_PAGE = "oauth2-redirect.html"
67

78

89
def openapi(request):
@@ -11,3 +12,11 @@ def openapi(request):
1112
# response NOT FOUND
1213
raise exceptions.NotFound("enable_swaggerui not active.")
1314
return render(request, OPENAPI_PAGE)
15+
16+
17+
def openapi_oauth2_redirect(request):
18+
# serve swagger ui landing page
19+
if not switch_is_active("enable_swaggerui"):
20+
# response NOT FOUND
21+
raise exceptions.NotFound("enable_swaggerui not active.")
22+
return render(request, OPENAPI_OAUTH2_REDIRECT_PAGE)

0 commit comments

Comments
 (0)