Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
djuarezgf committed Oct 18, 2024
1 parent 00b980a commit 2a3869b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@ const vueLifecycles = singleSpaVue({
app.use(router);
app.use(store);

// Load config before bootstrapping the application
export const bootstrap = async () => {
export const bootstrap = () => {
return new Promise((resolve) => {
// Load the configuration first
await getConfig();

const onAuthenticatedCallback = () => {
console.log('Authenticated!');
resolve(vueLifecycles.bootstrap);
};

// Continue with Keycloak authentication after config is loaded
KeyCloakService.CallLogin(onAuthenticatedCallback);
getConfig().then(() => {
const onAuthenticatedCallback = () => {
console.log('Authenticated!');
resolve(vueLifecycles.bootstrap);
};

// Continue with Keycloak authentication after config is loaded
KeyCloakService.CallLogin(onAuthenticatedCallback);
});
});
};

Expand Down

0 comments on commit 2a3869b

Please sign in to comment.