mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-09-09 10:58:16 +00:00
refactor: redirect to root path instead of login page on logout in Backoffice and Portal layouts
This commit is contained in:
@@ -87,7 +87,7 @@ export function BackofficeLayout() {
|
|||||||
const handleLogout = useCallback(() => {
|
const handleLogout = useCallback(() => {
|
||||||
dispatch(logout());
|
dispatch(logout());
|
||||||
dispatch(baseApi.util.resetApiState());
|
dispatch(baseApi.util.resetApiState());
|
||||||
navigate("/login");
|
navigate("/");
|
||||||
}, [dispatch, navigate]);
|
}, [dispatch, navigate]);
|
||||||
|
|
||||||
const segments = location.pathname.split('/').filter(Boolean);
|
const segments = location.pathname.split('/').filter(Boolean);
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ export function PortalLayout() {
|
|||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
dispatch(logout());
|
dispatch(logout());
|
||||||
dispatch(baseApi.util.resetApiState());
|
dispatch(baseApi.util.resetApiState());
|
||||||
navigate("/login");
|
navigate("/");
|
||||||
};
|
};
|
||||||
|
|
||||||
const displayName = user?.name?.en || user?.username || "";
|
const displayName = user?.name?.en || user?.username || "";
|
||||||
|
|||||||
Reference in New Issue
Block a user