From 868c5d9afe867daf897780a98c7e735ca3bb5649 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Tue, 22 Apr 2025 09:12:11 +0000 Subject: [PATCH] style: fix linting issues met Prettier --- frontend/src/router/index.ts | 2 +- frontend/src/services/auth/auth-service.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 901d376f..8092ffd5 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -138,7 +138,7 @@ const router = createRouter({ router.beforeEach(async (to, _from, next) => { // Verify if user is logged in before accessing certain routes if (to.meta.requiresAuth) { - if (!authService.isLoggedIn.value && !await authService.loadUser()) { + if (!authService.isLoggedIn.value && !(await authService.loadUser())) { next("/login"); } else { next(); diff --git a/frontend/src/services/auth/auth-service.ts b/frontend/src/services/auth/auth-service.ts index 92b5002d..0d67380c 100644 --- a/frontend/src/services/auth/auth-service.ts +++ b/frontend/src/services/auth/auth-service.ts @@ -40,9 +40,10 @@ async function loadUser(): Promise { const userManager = (await getUserManagers())[activeRole]; let user = await userManager.getUser(); // Load the user from the local storage. - if (!user) { // If the user is not in the local storage, he could still be authenticated in Keycloak. + if (!user) { + // If the user is not in the local storage, he could still be authenticated in Keycloak. try { - user = await userManager.signinSilent() + user = await userManager.signinSilent(); } catch (e: unknown) { // When the user was previously logged in and then logged out, signinSilent throws an error. // In that case, the user is not authenticated anymore, so we set him to null.