laravel-gmail icon indicating copy to clipboard operation
laravel-gmail copied to clipboard

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

Open umarzahid028 opened this issue 1 year ago • 2 comments

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.

umarzahid028 avatar Sep 25 '23 11:09 umarzahid028

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

pappu687 avatar Oct 08 '23 06:10 pappu687

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.

umarzahid028 avatar Oct 08 '23 20:10 umarzahid028