I'm trying to get our vue + okta app to work pulling the okta values from a congif.json in the public folder (so we can build and deploy automatically to various environments)
I'm following this pattern for the config.
Vue js with an external configuration file
Does Okta have an example of using okta with a config.json in the public folder to hold the values(in typescript by preference)?
I'm doing this, but it's not working, is
in main.ts
const sPath = `${process.env.BASE_URL} ${"config.json"}`;
// fetch(process.env.BASE_URL + "config.json")
fetch(sPath)
.then((response) => response.json())
.then((config) =>
{
Vue.prototype.$config = config;
new Vue({
router,
store,
render: (h) => h(App)
}).$mount("#app");
})
Then in router\index.ts
const confObj = Vue.prototype.$config;// confObj is undefiend here - EWB
//Vue.use( Auth,
// {
// confObj,
// } );
debugger;
Vue.use( Auth,
{
issuer: confObj.issuer,
client_id: confObj.client_id,
redirect_uri: confObj.redirect_uri,
scopes: [ 'openid', 'profile', 'email' ],
tokenManager: { storage: 'sessionStorage' },
} );
Vue.use(VueRouter)
When I get to it , configObj is still undefined.