Fatal error: Uncaught Exception: Could not json decode the token

SupportFatal error: Uncaught Exception: Could not json decode the token
callaghan_forsyth Staff asked 5 years ago
Hi, I've just purchased the Connect (BETA) extension and am receiving the following error when I go to cancel or confirm a new booking. .../plugins/easy-appointments-connect/vendor/google/apiclient/src/Google/Auth/OAuth2.php on line 186 "Fatal error: Uncaught Exception: Could not json decode the token" This error only occurs with the Connect extension and I've set up the Google Calendar multiple times to make sure it's correct. Please assist.
3 Answers
callaghan_forsyth Staff answered 5 years ago
Digging deeper here:   Line 186   " throw new Google_Auth_Exception('Could not json decode the token');"   Am I missing something with Google authentication? The new youtube instructions are of the old Google API setup, perhaps there is a step missing, API and Auth "Domain Verification"?
Nikola Loncar Staff answered 5 years ago
Hi, there is a new video. Created two months ago: https://www.youtube.com/watch?v=ltZ2G6_T8cI and by looking at your error message I will suggest that you try re-authorize again. Token is stored in JSON format. Best regards, Nikola
callaghan_forsyth Staff replied 5 years ago

Thank you Nikola.

Google Calendar Project and API recreated, site verified with Google. Still having the same issue.

Troubleshooting:
1) I’ve deactivated Connect. Confirm and Cancel work perfectly.
2) Deleted Connect. Reinstalled Connect and activated. No settings changed from default
Result: OAuth2.php on line 186 error

This is occurring without inputting anything Google related. I feel there is a bug in the code. Please help.

Nikola Loncar Staff answered 5 years ago
Hi, can you please try next thing. Go to Extension Google settings and remove token by clicking on button and try to authorise again? You should see dialog pop out and click on allow access. In case that you are not using google calendar sync please remove account id and secret. Best regards, Nikola
callaghan_forsyth Staff replied 5 years ago

Hi Nikola,

1) Token removed. Made a new booking, tried to confirm the booking. Error on line 186 exists again but in the appointments section, the booking has been confirmed.

2) Client ID and Secret added. Authorized and allowed through the corresponding Google account. Booking made, pressed confirm. Error on line 186 exists and as above, the booking has been confirmed but the error is still evident.

With a fresh install of Connect, no parameters set in the Extension Google and token removed, this error still appears.

callaghan_forsyth Staff replied 5 years ago

Also, I have the ability to download the JSON file from my Google API Credentials page, is there any benefit to this?

callaghan_forsyth Staff replied 5 years ago

Continuing with testing. After confirming, although I get the error, the Google Calendar is responsive and updates correctly.

The Line 186 error exists, but when I am logged out of my WP page, the visible message is “There has been a critical error on your website”. I am using “Query Monitor” plugin to receive the Line 186 error.

Nikola Loncar Staff replied 5 years ago

Can you please create a temp account for me so I can check what is going on there with settings. Email is nikolanbg[at]gmail[dot]com

Best regards,
Nikola

callaghan_forsyth Staff replied 5 years ago

Thanks Nikola, account added.

Nikola Loncar Staff replied 5 years ago

Thanks, I will check and let you know.

Best regards,
Nikola

callaghan_forsyth Staff replied 5 years ago

Hi Nikola, any resolution to this error yet?

Nikola Loncar Staff replied 5 years ago

Hi, trying to find solution to this one.