From 458bfc0faf3566f65554694e91adc47285becb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 3 Dec 2020 14:52:27 -0500 Subject: [PATCH] fix: external path for subfolder installs --- src/controllers/helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js index 28e53a5914..bd561ab169 100644 --- a/src/controllers/helpers.js +++ b/src/controllers/helpers.js @@ -148,8 +148,8 @@ helpers.redirect = function (res, url, permanent) { let redirectUrl; // this is used by sso plugins to redirect to the auth route if (url.hasOwnProperty('external')) { - redirectUrl = url.external; - url.external = encodeURI(url.external); + redirectUrl = res.local.isAPI ? relative_path + url.external : url.external; + url.external = encodeURI(redirectUrl); } else { redirectUrl = url; url = encodeURI(url);