mikejac / node-red-contrib-google-smarthome

A collection of Node-RED nodes to control your smart home devices via Google Assistant.
GNU General Public License v3.0
116 stars 36 forks source link

Expecting empty clientID #112

Open RSWilli opened 3 years ago

RSWilli commented 3 years ago

When I try to pair with GHome, I get the following error msg:

"Auth:isValidClient(): clientId does not match (expected "", got "<MY_CORRECT_ID>")!"

it somehow expects the client ID to be emtpy. I checked nginx access log, where

GET /oauth?response_type=code&client_id=<MY_CORRECT_ID>&...........

is logged. I also checked the code to try to understand my error a bit, where I came to the conclusion that the expected empty string has to come from the initialization in https://github.com/mikejac/node-red-contrib-google-smarthome/blob/master/lib/Auth.js#L32 , although it should get overwritten in https://github.com/mikejac/node-red-contrib-google-smarthome/blob/master/lib/SmartHome.js#L64

did I do something wrong?

RSWilli commented 3 years ago

it seems like the clientIdSecret function is not called after a "Deploy" in Node Red. It must have taken an old config value, which was empty. A full restart of Node Red fixed the issue.

A more permanent fix for this issue would be to call the setClientIdSecret function after a redeploy

RSWilli commented 3 years ago

it seems like this is the case for more places:

e.g. the light on/off node does not send a message after a redeploy, even though it updates its status