mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
[FEAT/BE] add return fe cors
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user