diff --git a/src/wellKnownOIDCConfiguration.js b/src/wellKnownOIDCConfiguration.js index 2444bf9b..764a5d51 100644 --- a/src/wellKnownOIDCConfiguration.js +++ b/src/wellKnownOIDCConfiguration.js @@ -3,10 +3,7 @@ const { getRequestBaseURL } = require("./lib"); module.exports = (req, res) => { - const prefix = `${getRequestBaseURL(req)}${ - (req.originalUrl || req.url) - .replace(/\/\.well-known\/openid-configuration\/?$/, "") - }${config.authBaseUrl}`; + const prefix = `${getRequestBaseURL(req)}${req.baseUrl}/auth`; const json = { diff --git a/src/wellKnownSmartConfiguration.js b/src/wellKnownSmartConfiguration.js index ee17c2f3..e594be12 100644 --- a/src/wellKnownSmartConfiguration.js +++ b/src/wellKnownSmartConfiguration.js @@ -1,12 +1,8 @@ -const config = require("./config"); const { getRequestBaseURL } = require("./lib"); module.exports = (req, res) => { - const prefix = `${getRequestBaseURL(req)}${ - (req.originalUrl || req.originalUrl) - .replace(/\/fhir\/\.well-known\/smart-configuration\/?$/, "") - }${config.authBaseUrl}`; + const prefix = `${getRequestBaseURL(req)}${req.baseUrl}/auth`; const json = {