guruahn / vue-google-oauth2

🔌 Handling Google sign-in and sign-out for Vue.js applications
MIT License
184 stars 55 forks source link

isSignedIn state gone after 1 hour #51

Closed richie87 closed 3 years ago

richie87 commented 3 years ago

Hey,

I'm currently trying to integrate your package into my Application. The authentication process of my SaaS-App is my own, so there is no Google Auth.

I just want to get permission to access the Google Calendar of my app users at the end of the day 😄

Right now i've implemented the Google "Sign-In" button via your package with the getAuthCode() method and i'm getting the one-time code from Google. Then the exchange is done on backend-side, to get refresh code and so on. So far so good.

The only problem i'm having now is that after 1 hour (lifetime of code/token) the state isSignedIn of the user is false.

The reason i need the state on frontend-side is, that i want to give the user the ability to "opt-out" from my service and revoke google permissions via disconnect() method. This works perfectly within 1 hour.

I wasn't able to find any example to achieve this. Can you help me?

Thanks!

richie87 commented 3 years ago

I solved it, by doing the revoke on backend-side: https://developers.google.com/identity/protocols/oauth2/web-server#httprest_8