Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1613 from Shopify/wrap-uri-encoded-values-double-…
Browse files Browse the repository at this point in the history
…quotes

Wrap redirectTo values in double quotes
  • Loading branch information
Keyfer Mathewson authored Aug 26, 2020
2 parents 0270ae8 + b3086eb commit 3b21dbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/koa-shopify-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] -->
## [Unreleased]

- Wrap `encodeURI` values in double quotes [1613](https://github.com/Shopify/quilt/pull/1613)

## [3.1.67] - 2020-08-26

Expand Down
6 changes: 3 additions & 3 deletions packages/koa-shopify-auth/src/auth/redirection-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}
});
</script>
Expand Down

0 comments on commit 3b21dbe

Please sign in to comment.