diff --git a/ts/client.ts b/ts/client.ts index 567db466..a2a66507 100644 --- a/ts/client.ts +++ b/ts/client.ts @@ -44,7 +44,7 @@ class ApiClient { return this._isAuthenticated; } - setLoggedIn(value: boolean): void { + setAuthenticated(value: boolean): void { this._isAuthenticated = value; } diff --git a/ts/components/PlanningColumnDetail.vue b/ts/components/PlanningColumnDetail.vue index a11d4908..fd0064f5 100644 --- a/ts/components/PlanningColumnDetail.vue +++ b/ts/components/PlanningColumnDetail.vue @@ -10,15 +10,7 @@ Active Investigation Workbench
-
- -
+

loading...

diff --git a/ts/router.ts b/ts/router.ts index a25c746e..930fcb65 100644 --- a/ts/router.ts +++ b/ts/router.ts @@ -224,13 +224,13 @@ router.beforeEach(async (to, from) => { try { // Check if user is authenticated (could be an API call) if (!apiClient.isAuthenticated) { - return "/_/signin"; + return "/signin"; } else { return; } } catch (error) { console.log("check auth failed"); - return "/_/signin"; + return "/signin"; } } }); diff --git a/ts/store/session.ts b/ts/store/session.ts index 7d841211..811856d9 100644 --- a/ts/store/session.ts +++ b/ts/store/session.ts @@ -36,6 +36,7 @@ export const useSessionStore = defineStore("session", () => { try { const data: Session = await apiClient.JSONGet("/api/session"); + apiClient.setAuthenticated(true); impersonating.value = data.impersonating || null; notification_counts.value = data.notification_counts; organization.value = data.organization; @@ -43,6 +44,7 @@ export const useSessionStore = defineStore("session", () => { urls.value = data.urls; return data; } catch (e) { + apiClient.setAuthenticated(false); error.value = e instanceof Error ? e.message : "an error ocurred"; console.error("Error fetching user:", e); throw new Error(error.value); diff --git a/ts/view/Signout.vue b/ts/view/Signout.vue index 297f6513..9a47a9e6 100644 --- a/ts/view/Signout.vue +++ b/ts/view/Signout.vue @@ -3,12 +3,14 @@