My MERN stack app works like this:
- User logs in with google account (Auth0)
- User fills up a form and clicks submit. Post request is sent to API with Bearer token and data
- ExpressJs API on the backend validates JWT. If it is valid, the data gets saved in database
Here, I’m able to login using google. However when I fill up the form and click submit, I’m getting unauthorized error with a status code of 401. The exact error I’m seeing is ,
"InvalidTokenError: Invalid URL
at D:\Projects\2022\MV\mvjuly\node_modules\express-oauth2-jwt-bearer\dist\index.js:271:19
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async D:\Projects\2022\MV\mvjuly\node_modules\express-oauth2-jwt-bearer\dist\index.js:354:24"