Kubessandra / react-google-calendar-api

An api to manage your google calendar
MIT License
215 stars 88 forks source link

User needs to login after page refresh in order to add event #85

Open aniketkambli opened 2 years ago

aniketkambli commented 2 years ago

The example is working fine but when i refresh the page, the google's session is not stored in browser and hence the user has to login again and provide consent before adding an event or else it throws error

aniketkambli commented 2 years ago

Also how to create events with custom start/end time and start/end date

Kubessandra commented 2 years ago
  /**
    * Create calendar event
    * @param {string} CalendarId for the event by default use 'primary'.
    * @param {object} Event with start and end dateTime
    * @param {string} sendUpdates Acceptable values are: "all", "externalOnly", "none"
    * @returns {any} Promise on the event.
    */
   public createEvent(event: object, calendarId: string = this.calendar, sendUpdates: string = 'none',): any {

With this method you can use a start and end dateTime.

For the login issue, this was introduced with the new API of google where they do not manage the session state anymore. I havn't found the time to find a solution yet.

aniketkambli commented 2 years ago

okay cool, let me know once you find a workaround for session persistence. Other than that great work on the package 👍

MatiasZelayaDept commented 2 years ago

Hi ! Any news about this issue? I have the same problem

udaniketk commented 2 years ago

Nah, still stuck on the same problem. Let me know if you find a workaround

Kubessandra commented 2 years ago

I havn't found the time to find a workaround with google yet..

MatiasZelayaDept commented 2 years ago

Maybe you can made a method to return the token and the refresh token and the user can handle that outside the library

Kubessandra commented 2 years ago

You already have access to it by using apiCalendar.tokenClient

https://developers.google.com/identity/oauth2/web/guides/use-token-model

MatiasZelayaDept commented 2 years ago

The token client dont have the information about the token, only the info about the user, and doesnt have the refresh token either

JanderSilv commented 1 year ago

Any updates on this issue?

UsamaEjaz0 commented 1 year ago

Any updates

gabrielpagotto commented 1 year ago

Any updates about this issue?

Kubessandra commented 1 year ago

Did not find the solution with the new Google API, if you have any idea, we can try to do a PR, but yes this is really annoying