I have an angular application with a nodejs backend. I followed the official angular-auth0 tutorial and it worked as expected.
I also created an API to secure some backend routes but now I am struggling to extract the user_id from the token passed in the request header from the frontend.
I need the user_id to reference it in my database. I use the jwt-decode library to decode the token and then use the “sub” property instead. Is this a good workaround? I prefer to use the user_id.
Any advice are appreciated. Thank you