Hi. I’m new to auth0 and been reading a lot and done most of the tutorials that includes (vue and node as server)
Also, this vue quickstart is awesome to follow along. Everything went smoothly.
I’m trying to create a SPA game that enables users to trade, craft and have inventory of items.
My questions are
-
Say, I wanted to
post
a newly crafted item on/api/craft/
. How should I access the currently logged in user on the server side (node)?req.user
does not contain the user profiles.Tho there’s a way to get the user on/userinfo
endpoint. How should I approach this? Should I always get the user on/userinfo
every time I need user’s info? Or should I just include the user from SPA to my server as part of the payload? -
When getting a
access_token
, it can be accessed byauth0Client.getTokenSilently
, should I just use it every time I need a token? Or should I store the access token on localstorage since it can’t be hidden.
Please let me know your thoughts