randomBrainstormer / MMM-GoogleCalendar

Google Calendar for MagicMirror²
MIT License
64 stars 45 forks source link

Error running authorize.js #17

Closed mikmat closed 1 year ago

mikmat commented 2 years ago

I'm running into an error when running the authorize.js script ` pi@raspberrypi:~/MagicMirror/modules/MMM-GoogleCalendar $ node authorize.js /home/pi/MagicMirror/modules/MMM-GoogleCalendar/authorize.js:37 redirect_uris[0] ^

TypeError: Cannot read property '0' of undefined at authorize (/home/pi/MagicMirror/modules/MMM-GoogleCalendar/authorize.js:37:18) at fs.readFile (/home/pi/MagicMirror/modules/MMM-GoogleCalendar/authorize.js:23:3) at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3) `

DizzyDwarf0013 commented 2 years ago

Any luck on this? I'm having the same issue.

randomBrainstormer commented 2 years ago

Hi @mikmat @DizzyDwarf0013,

This error means the credentials you're using is missing a value in it called redirect_uris , try creating or updating your credentials from google cloud and check if there's any blank field for redirect urls. You can use localhost:8080 as value or whatever is the address of your MagicMirror in the browser. If this doesn't work, check if your credential type is supported by this module.

DizzyDwarf0013 commented 2 years ago

I guess the question would be if "TV & Limited Input devices" is supported the same as the "TV and unlimited input" is that is referenced here. "TV and unlimited input" is not an option.

randomBrainstormer commented 2 years ago

try "TV & Limited Input devices"

let me know if it works!

DizzyDwarf0013 commented 2 years ago

I tried starting from scratch and using "TV and Limited Input devices" again and received the same error as @mikmat described again. I ended up just creating one using "Web application" and using http://localhost:8080 as the Authorized JavaScript origins and Authorized redirect URIs. And then I had to sign in with my account once MM initiated.

mikmat commented 2 years ago

As @DizzyDwarf0013 mentioned, the "TV and Limited Input" type did not work. Using "Web application" and signing in with my account did the trick.

Great job guys!

elgeorgie commented 2 years ago

Same issues here. However, the "web application" alternative did not work for me. After I click allow on the google prompt I get a page not found error, and MM still display click here to enable this module.

nod commented 2 years ago

I am seeing the same issues.

Apparently the TV type creds from Google no longer includes any redirect_uri member.

The web type has moved the namespace to be credentials.web.

aerothan commented 1 year ago

Same issues here. However, the "web application" alternative did not work for me. After I click allow on the google prompt I get a page not found error, and MM still display click here to enable this module.

Same issue TV creds didnt work for me and getting the page not found error because im running the MM through unraid docker, so im not on the same browser as the MM is. Any solutions?

randomBrainstormer commented 1 year ago

A new version of this module has been released, now only supporting Desktop app as the OAuth type, it should fix these errors. Closing this for now, feel free to open a new issue if problem persist in the new version.