I am using react.
I have a link in my App.js:
<a href = "url"> Grant Access</a>
When a user clicks on the link, it brings them to a login page. Once successfully logged in, the user will be redirected to http://localhost:3001/.
However, the authorisation code will be within the url: 'http://localhost:3001/?code=8FNFZAJoEu10gqVxxW_NKw0EDj31XacCApZN1E4z&state='
How would I extract that code and use it for a GET request with axios from my nodejs?
I simply do not know where to start.
Please look at one of our tutorials, for example, https://forge-tutorials.autodesk.io/tutorials/hubs-browser, where we explain the process of extracting the temporary code and exchanging it for an access token. For that particular tutorial, the important line of code is this one: https://github.com/Autodesk-Forge/forge-hubs-browser-nodejs/blob/develop/services/forge/auth.js#L12.