diff --git a/client/src/router/__tests__/guards.spec.ts b/client/src/router/__tests__/guards.spec.ts index c4384db1..9b095f8d 100644 --- a/client/src/router/__tests__/guards.spec.ts +++ b/client/src/router/__tests__/guards.spec.ts @@ -34,6 +34,6 @@ describe("Guards", () => { courseSlug: "test", }, }; - expect(expertRequired(to)).toEqual(to); + expect(expertRequired(to)).toBe(true); }); }); diff --git a/client/src/router/guards.ts b/client/src/router/guards.ts index 47dddb6c..e04a5d46 100644 --- a/client/src/router/guards.ts +++ b/client/src/router/guards.ts @@ -37,7 +37,7 @@ const loginRequired = (to: RouteLocationNormalized) => { export const expertRequired: NavigationGuard = (to: RouteLocationNormalized) => { const courseSessionsStore = useCourseSessionsStore(); if (courseSessionsStore.hasCockpit) { - return to; + return true; } else { const courseSlug = to.params.courseSlug as string; return `/course/${courseSlug}/learn`;