From b3086ebec33d34258280a7a4dad5fc9075972372 Mon Sep 17 00:00:00 2001 From: Jenn Newton Date: Wed, 26 Aug 2020 15:05:29 -0400 Subject: [PATCH] Wrap redirectTo values in double quotes --- packages/koa-shopify-auth/CHANGELOG.md | 4 +++- packages/koa-shopify-auth/src/auth/redirection-page.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/koa-shopify-auth/CHANGELOG.md b/packages/koa-shopify-auth/CHANGELOG.md index 7c702c784b..804257f322 100644 --- a/packages/koa-shopify-auth/CHANGELOG.md +++ b/packages/koa-shopify-auth/CHANGELOG.md @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - +## [Unreleased] + +- Wrap `encodeURI` values in double quotes [1613](https://github.com/Shopify/quilt/pull/1613) ## [3.1.67] - 2020-08-26 diff --git a/packages/koa-shopify-auth/src/auth/redirection-page.ts b/packages/koa-shopify-auth/src/auth/redirection-page.ts index 56f20cd7e9..b4b04d8a26 100644 --- a/packages/koa-shopify-auth/src/auth/redirection-page.ts +++ b/packages/koa-shopify-auth/src/auth/redirection-page.ts @@ -4,18 +4,18 @@ export default function redirectionScript({origin, redirectTo, apiKey}) { document.addEventListener('DOMContentLoaded', function() { if (window.top === window.self) { // If the current window is the 'parent', change the URL by setting location.href - window.location.href = '${redirectTo}'; + window.location.href = "${redirectTo}"; } else { // If the current window is the 'child', change the parent's URL with postMessage var AppBridge = window['app-bridge']; var createApp = AppBridge.default; var Redirect = AppBridge.actions.Redirect; var app = createApp({ - apiKey: '${apiKey}', + apiKey: "${apiKey}", shopOrigin: "${encodeURI(origin)}", }); var redirect = Redirect.create(app); - redirect.dispatch(Redirect.Action.REMOTE, '${redirectTo}'); + redirect.dispatch(Redirect.Action.REMOTE, "${redirectTo}"); } });