Closed Michael-Gibbons closed 1 year ago
PR open
Side note, this is a also minor optimization, currently the verify request middleware is requesting the session then that data goes into the void and we must request it again. Causing 2 requests for the same session, by storing it in a local we reduce it to 1.
Using the following code to retrieve a session every time you need it is a bit verbose.
I believe it would be better to have middleware to store the session in a local like so, as well as setting the local in the
verify-request
middlewareusage would be like so
Or if the route is using the
verifyRequest
middleware it would also be accessible withres.locals.shopify.session