Skip to content

Accessing current session from the client side #119

Answered by kinngh
john-kuo asked this question in Q&A
Discussion options

You must be logged in to vote
  1. You shouldn't be accessing session client side - it's not safe since you're exposing user's online session tokens and your app's static offline tokens.
  2. To get tokens on the server, on a regular (non-proxy) route, you can just use res.locals.user_session that is exposed from verifyRequest to get user's online session tokens.

I'm guessing you want to make calls to Shopify to fetch orders / products / something else, and you're better off making an Express route and pulling in that way. Use clientProvider to make requests instead of having to worry about doing it manually. Also, since you're using this as a starter, please spend some time going through every middleware and util function th…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@john-kuo
Comment options

Answer selected by john-kuo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants