diff --git a/packages/koa-shopify-auth/src/auth/create-enable-cookies.ts b/packages/koa-shopify-auth/src/auth/create-enable-cookies.ts index 7b6687ba46..2ac4dad65b 100644 --- a/packages/koa-shopify-auth/src/auth/create-enable-cookies.ts +++ b/packages/koa-shopify-auth/src/auth/create-enable-cookies.ts @@ -370,7 +370,7 @@ export default function createEnableCookies({apiKey}: OAuthStartOptions) { (function() { function setCookieAndRedirect() { document.cookie = "shopify.cookies_persist=true"; - window.location.href = window.shopOrigin + "/admin/apps/" + window.apiKey; + window.location.href = "/auth?shop=${shop}" } function shouldDisplayPrompt() { diff --git a/packages/koa-shopify-auth/src/auth/test/enable-cookies.test.ts b/packages/koa-shopify-auth/src/auth/test/enable-cookies.test.ts index f2502cb2e6..e2c67732ed 100644 --- a/packages/koa-shopify-auth/src/auth/test/enable-cookies.test.ts +++ b/packages/koa-shopify-auth/src/auth/test/enable-cookies.test.ts @@ -25,5 +25,6 @@ describe('CreateEnableCookies', () => { expect(ctx.body).toContain('CookiePartitionPrompt'); expect(ctx.body).toContain(baseConfig.apiKey); expect(ctx.body).toContain(shopOrigin); + expect(ctx.body).toContain(`window.location.href = "/auth?shop=${shop}"`); }); });