From f119a00a96ac0495e489730693e9a95bb6d9020c Mon Sep 17 00:00:00 2001 From: Anne Stellingwerf Date: Sat, 28 Aug 2021 15:06:21 +0200 Subject: [PATCH] improvement: generate default oauth2RedirectUrl based on page location, including the path (an omission of #5085) --- src/core/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/index.js b/src/core/index.js index 6cb29a30142..bf684426ce0 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -36,7 +36,7 @@ export default function SwaggerUI(opts) { maxDisplayedTags: null, filter: null, validatorUrl: "https://validator.swagger.io/validator", - oauth2RedirectUrl: `${window.location.protocol}//${window.location.host}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'))}/oauth2-redirect.html`, + oauth2RedirectUrl: `${window.location.protocol}//${window.location.host}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/"))}/oauth2-redirect.html`, persistAuthorization: false, configs: {}, custom: {},