From e2a4088e779520dcde954e302ff9634ff235ff76 Mon Sep 17 00:00:00 2001 From: ragilap Date: Thu, 26 Feb 2026 11:19:47 +0700 Subject: [PATCH] [FEAT/BE] add return fe cors --- src/components/Navbar.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index ce17f6b8..7627e53a 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -26,13 +26,17 @@ const Navbar = ({ toggleSidebar }: NavbarProps) => { const logoutClickHandler = async () => { const logoutRes = await AuthApi.logout(); - if (isResponseError(logoutRes)) { toast.error('Gagal logout! Coba lagi!'); return; } setUser(undefined); + const redirect = (logoutRes as { redirect?: string })?.redirect; + if (redirect) { + window.location.href = redirect; + return; + } router.replace(process.env.NEXT_PUBLIC_SSO_LOGIN_URL as string); };