shopify-api-js icon indicating copy to clipboard operation
shopify-api-js copied to clipboard

Issue with detecting scope changes

Open lukeclifton opened this issue 3 years ago • 0 comments

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) {

lukeclifton avatar Apr 14 '22 12:04 lukeclifton