Shopify / koa-shopify-auth

DEPRECATED Middleware to authenticate a Koa application with Shopify
MIT License
80 stars 63 forks source link

Change to permissions scope #97

Closed assaflei closed 1 year ago

assaflei commented 3 years ago

Issue summary

While testing the package in my app, I came to a situation where I need to change permissions as part of app usage. When installing the app the permissions are set and if a feature is selected, I add additional permissions. When using the cookie based version I was using the createShopifyAuth method with updated scopes option and the app would redirect to authorization screen. In the new version, I arrive to the afterAuth callback immediately without going to the authorization screen

This code part had stopped referring to authorization screen:

//adding write_orders permission to list of permissions
const doAuth = createShopifyAuth({
            scopes: SHOPIFY_BASE_PERMISSIONS.split(',').concat('write_orders'),
            accessMode: 'offline',
            prefix: '/addorders',
            async afterAuth(ctx) {
     .......
            }
        });
        return doAuth(ctx, next);

Expected behavior

When changing scopes, createShopifyAuth method should cause a redirect to authorization screen.

Actual behavior

What actually happens?

No redirection, callback is reached with no change to the scopes

Any suggestions? Thanks, Assaf

assaflei commented 3 years ago

Anyone?

ghost commented 3 years ago

same issue

devopsangel commented 3 years ago

noticed the same.

inerc commented 3 years ago

same

xroussel commented 3 years ago

same

github-actions[bot] commented 1 year ago

Note that this repo is no longer maintained and this issue will not be reviewed. Prefer the official JavaScript API library. If you still want to use Koa, see simple-koa-shopify-auth for a potential community solution.