Google oauth on Node redirect_uri_mismatch error

Wappler Version : 3.4
Operating System : Remote Node

Expected behavior

Google oauth should work on node, as it does on php

Actual behavior

The following error is receive when Google redirects after authorization:

{
  "status": "500",
  "message": "Http status code 400. {\n  \"error\": \"redirect_uri_mismatch\",\n  \"error_description\": \"Bad Request\"\n}",
  "stack": "Error: Http status code 400. {\n  \"error\": \"redirect_uri_mismatch\",\n  \"error_description\": \"Bad Request\"\n}\n    at IncomingMessage.<anonymous> (/home/dev-01/domains/nodeworld1.uniqueideas.com/nodeapp/lib/oauth/index.js:87:39)\n    at IncomingMessage.emit (events.js:327:22)\n    at endReadableNT (_stream_readable.js:1221:12)\n    at processTicksAndRejections (internal/process/task_queues.js:84:21)"
}

The URL being redirected to is:

https://nodeworld1.uniqueideas.com/api/oauth/google?state=83ce6fda-a999-4739-8e0d-b22eb0a0c615&code=4/5QESp-qgD_82koo_REDACTEDUPe9B54Y3ZWJw5hNx_KHG7RpuRV2w&scope=https://www.googleapis.com/auth/gmail.readonly

How to reproduce

Create this on php, and it runs properly.

Create this on node and it produces the error.

Community Page
Last updated: