dacastro4 / laravel-gmail

Laravel wrapper for the Gmail API
MIT License
289 stars 133 forks source link

refresh token must be passed in or set as part of setaccesstoken #265

Open umarzahid028 opened 11 months ago

umarzahid028 commented 11 months ago

I've encountered a new issue right after authorizing Google. Firstly, I received the following error message:

"Refresh token must be passed in or set as part of setaccesstoken (view: /var/www/html/domain/resources/views/layouts/header.blade.php)."

To temporarily resolve this, I deleted the file located at "storage/app/gmail/tokens/gmail-json.json" and then re-authenticate. This allows the application to work again. However, after approximately one hour, the same problem recurs.

Could you please assist me with this issue? My application is currently live, and this problem is affecting its functionality.

pappu687 commented 11 months ago

I have the same issue @dacastro4 - do you have time to look at this ?

umarzahid028 commented 11 months ago

I identified the issue and resolved it. To generate the token successfully, make sure to include the GOOGLE_PROJECT_ID, like this: LaravelGmail::setUserId("gmail-api-000964")->makeToken();

This worked correctly in my case, and I hope it works for you as well.