OK - Very strange. After reading this post I went back to Google API config and added the localhost redirection URL.
The immediate result was that the OAuth2 dialogue presented me with my Google accounts (!!!). However once I approved the permissions the process breaks because the browser is then trying to redirect to localhost and this obviously doesn’t work.
With the variables you’ve setup, the redirect URI in n8n editor should match the domain you’ve setup. Are you sure the env vars are being read/applied?
Thanks @hrishikesh. When using process I’m getting an error Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.
Problem solved! I’m using n8n’s self hosted starter kit which uses docker-compose.
The variables I have in .env are not picked up by docker unless explicitly adding an -env_file directive to docker-compose.yml