- Added proper oauth2 authentication with google and saving of the access token to the profile

This commit is contained in:
Dejan
2024-10-11 10:28:49 +02:00
parent e1c03c840d
commit 7d9d41acfc
2 changed files with 50 additions and 64 deletions

View File

@ -1,4 +1,5 @@
export async function fetchGoogleCalendarEvents(token, startDate, endDate) {
console.log(token);
const response = await fetch(
`https://www.googleapis.com/calendar/v3/calendars/primary/events?single_events=true&time_min=${startDate}&time_max=${endDate}`,
{
@ -9,6 +10,7 @@ export async function fetchGoogleCalendarEvents(token, startDate, endDate) {
);
const data = await response.json();
console.log(data);
const googleEvents = [];
data.items?.forEach((item) => {
let isAllDay = false;