refactor: rework frontend use effect calls (#630)

* refactor: rework frontend use effect calls

* fix: rabbit comments

* fix: handle empty oauth url in login page
This commit is contained in:
Stavros
2026-02-07 12:01:19 +02:00
committed by GitHub
parent fa1c5292f9
commit f08d8593ea
6 changed files with 187 additions and 107 deletions

View File

@@ -29,7 +29,7 @@ export const LogoutPage = () => {
});
redirectTimer.current = window.setTimeout(() => {
window.location.assign("/login");
window.location.replace("/login");
}, 500);
},
onError: () => {
@@ -39,12 +39,13 @@ export const LogoutPage = () => {
},
});
useEffect(
() => () => {
if (redirectTimer.current) clearTimeout(redirectTimer.current);
},
[],
);
useEffect(() => {
return () => {
if (redirectTimer.current) {
clearTimeout(redirectTimer.current);
}
};
}, [redirectTimer]);
if (!isLoggedIn) {
return <Navigate to="/login" replace />;