master
alex 2024-01-14 20:49:29 +01:00
parent c638dcbaad
commit 0fb6bec94c
1 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,10 @@ export default function StoreCalendar() {
const [isRequesting, setIsRequesting] = useState(true); const [isRequesting, setIsRequesting] = useState(true);
useEffect(() => { useEffect(() => {
// delete session cookie
document.cookie = `session=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
myFetch("/calendar/settings", "GET") myFetch("/calendar/settings", "GET")
.then((res) => { .then((res) => {
console.log(res); console.log(res);
@ -40,9 +44,7 @@ export default function StoreCalendar() {
<Button <Button
//href={`${Constants.API_ADDRESS}/calendar/auth/google`} //href={`${Constants.API_ADDRESS}/calendar/auth/google`}
onClick={() => { onClick={() => {
document.cookie = `session=${getUserSessionFromLocalStorage()}; max-age=${ document.cookie = `session=${getUserSessionFromLocalStorage()}; path=/;`;
5 * 60
}; path=/;`;
window.location.href = `${Constants.API_ADDRESS}/calendar/auth/google`; window.location.href = `${Constants.API_ADDRESS}/calendar/auth/google`;
}} }}