diff --git a/controller/src/classes/Controller.ts b/controller/src/classes/Controller.ts index a706530..aa3aad1 100644 --- a/controller/src/classes/Controller.ts +++ b/controller/src/classes/Controller.ts @@ -93,10 +93,10 @@ export class Controller> return this.accessRequest; } - setPodUrl(podUrl: string) { + async setPodUrl(podUrl: string) { this.index.setPodUrl(podUrl); this.resources.setPodUrl(podUrl); - this.accessRequest.setPodUrl(podUrl) + await this.accessRequest.setPodUrl(podUrl) } unsetPodUrl() { diff --git a/controller/src/types/modules.ts b/controller/src/types/modules.ts index 72f6ae5..d5fb159 100644 --- a/controller/src/types/modules.ts +++ b/controller/src/types/modules.ts @@ -10,7 +10,7 @@ export type SubjectConfig>> = Record>; export interface IController>> { - setPodUrl(podUrl: string): void; + setPodUrl(podUrl: string): Promise; unsetPodUrl(podUrl: string): void; AccessRequest(): IAccessRequest; getLabelForSubject>(subject: T[K]): string; diff --git a/loama/src/router/index.ts b/loama/src/router/index.ts index 2fcef16..1b21d02 100644 --- a/loama/src/router/index.ts +++ b/loama/src/router/index.ts @@ -48,7 +48,7 @@ router.beforeEach(async (to) => { if (store.session.info.isLoggedIn) { // Default to the first pod const currentPodUrl = (await listPodUrls(store.session))[0] - activeController.setPodUrl(currentPodUrl); + await activeController.setPodUrl(currentPodUrl); store.setUsedPod(currentPodUrl) } if (!store.session.info.isLoggedIn && to.name !== 'login') {