[#34] added ky and condition to reconnect user on refresh

This commit is contained in:
Camille Moussu
2025-07-15 16:56:43 +02:00
parent aa3ecff9ef
commit 7507d09d72
9 changed files with 762 additions and 946 deletions
+1 -2
View File
@@ -9,8 +9,6 @@ import { getCalendarsListAsync } from "../Calendars/CalendarSlice";
export function CallbackResume() {
const dispatch = useAppDispatch();
const hasRun = useRef(false);
const calendars = useAppSelector((state) => state.calendars);
const userId = useAppSelector((state) => state.user.userData?.openpaasId);
const saved = sessionStorage.getItem("redirectState")
? JSON.parse(sessionStorage.getItem("redirectState")!)
: null;
@@ -28,6 +26,7 @@ export function CallbackResume() {
dispatch(getCalendarsListAsync(data?.tokenSet.access_token ?? ""));
sessionStorage.removeItem("redirectState");
sessionStorage.setItem("tokenSet", JSON.stringify(data?.tokenSet));
// Redirect to main page after successful callback
dispatch(push("/"));
} catch (e) {