When I test the oauth2 provider + authorize step without the third step; api action, it returns me the access token fine. When I add the api action query I get the following error:
{"status":"500","message":"Cannot use 'in' operator to search for 'length' in null","stack":"TypeError: Cannot use 'in' operator to search for 'length' in null\n at RedirectableRequest.write (/app/node_modules/follow-redirects/index.js:72:75)\n at /app/lib/modules/api.js:92:17\n at new Promise (<anonymous>)\n at App.send (/app/lib/modules/api.js:66:16)\n at App._exec (/app/lib/core/app.js:251:57)\n at App._exec (/app/lib/core/app.js:233:28)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)\n at async App.exec (/app/lib/core/app.js:204:9)\n at async App.define (/app/lib/core/app.js:187:9)"}
I have tested everything in postman and it works fine. Any thoughts @Teodor?
I have another problem, after I am redirected back from my oauth provider’s site I have this error from the api/oauth.json page:
Failed to load resource: the server responded with a status of 401 (Unauthorized)
The user is created in the database but without any of the api’s data id & email.
I have a final step to redirect the page after user creation but that is not completed either.
I think the issue is with the schema definition. I spent a few hours trying different things (with no meaningful message using debug) kind of stuck thinking this is another bug.
When creating the user, none of the data from GetUser is returned & then the page is not direct either. It hangs on oauth.json showing “Unauthorized”.
I have it working now, it was my mistake. The confusion was because there was a data object inside data & I didn’t include that in the schema definition.