From 002b9340e38d9d13f032e548d63deafc2194fbe3 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 1 Oct 2024 15:40:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=82(frontend)=20redirect=20to=20the=20?= =?UTF-8?q?OIDC=20when=20private=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We now redirect to the OIDC when a user is on a private doc and get a 401 error. --- src/frontend/apps/impress/src/pages/docs/[id]/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx index 2f2d92b9..378713c9 100644 --- a/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx +++ b/src/frontend/apps/impress/src/pages/docs/[id]/index.tsx @@ -32,7 +32,7 @@ interface DocProps { } const DocPage = ({ id }: DocProps) => { - const { authenticated, login } = useAuthStore(); + const { login } = useAuthStore(); const { data: docQuery, isError, error } = useDoc({ id }); const [doc, setDoc] = useState(docQuery); @@ -60,7 +60,7 @@ const DocPage = ({ id }: DocProps) => { return null; } - if (error.status === 401 && !authenticated) { + if (error.status === 401) { login(); return null; }