I did some searching on the forum and found this comment which was the most helpful: https://answers.netlify.com/t/verify-user-in-node-js-backend/3916/3
However I still have some questions on how to go about this. Currently my FE is making a request to my backend directly, to which I would now like to add auth. From my reading of the above comment and linked documentation, my thought process for how it has to work is the following.
Instead of making the call directly to the backend, I now make the call to the endpoint for a new Netlify Function I define. I pass in the JWT via the header so that it’s automatically authed for me and the user information attached to the
I now bundle this data with the rest of the query I want to send to my backend using fetch. However, I want to sign the outgoing data so that my backend knows it is coming from Netlify. Therefore what I actually do is I fetch a “local” endpoint, but define a redirect with the signing value filled and pointed toward my backend(?). My lambda function then waits for the result and simply passes it back to the FE to use as it was using it before.
Does this make sense or am I overthinking this?