shopify-api-js
shopify-api-js copied to clipboard
Issue with detecting scope changes
Issue summary
The docs say to detect scope changes in this way: https://github.com/Shopify/shopify-node-api/blob/main/docs/usage/oauth.md#detecting-scope-changes
if (!Shopify.Context.SCOPES.equals(session.scope)) {
// Scopes have changed, the app should redirect the merchant to OAuth
}
However this conditional always seems to return false even when the scope strings match.
I had to restort to using following logic:
if (Shopify.Context.SCOPES.toString() !== session.scope) {