Merge branch 'fix/fe/return-to-logout' into 'development'

[FIX/FE] add return fe cors

See merge request mbugroup/lti-web-client!334
This commit is contained in:
Rivaldi A N S
2026-02-26 04:27:56 +00:00
+5 -1
View File
@@ -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);
};