fix(config): add options defined during runtime (#9845)

Refs #9844
This commit is contained in:
Oliwia Rogala
2024-04-18 16:40:04 +02:00
committed by GitHub
parent bcd7388a2d
commit 60670d1bbd
4 changed files with 24 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
/**
* @prettier
*
* Receives options at runtime.
*/
/* eslint-disable no-undef */
const optionsFromRuntime = () => () => {
const options = {}
if (globalThis.location) {
options.oauth2RedirectUrl = `${globalThis.location.protocol}//${globalThis.location.host}${globalThis.location.pathname.substring(0, globalThis.location.pathname.lastIndexOf("/"))}/oauth2-redirect.html`
}
return options
}
export default optionsFromRuntime