Improve redirection when logging in with google

This commit is contained in:
Arthur Belleville 2025-03-27 09:07:38 +01:00
parent 2e429535ab
commit c6ff823601
No known key found for this signature in database

View file

@ -1,12 +1,17 @@
import { useEffect } from "react";
import { useNavigate } from "react-router-dom";
import { useSession } from "../contexts/SessionContext";
export const OAuthSigninPage = () => {
const navigate = useNavigate();
const { session } = useSession();
useEffect(() => {
setTimeout(() => {
navigate("/");
const interval = setInterval(() => {
if (session) {
navigate("/");
}
}, 100);
}, [navigate]);
return () => clearInterval(interval);
}, [navigate, session]);
return <></>;
};