Skip to content

Commit

Permalink
Merge pull request #584 from Shopify/liz/external-redirect-on-action
Browse files Browse the repository at this point in the history
Fix a external redirects failing in actions
  • Loading branch information
lizkenyon authored Jan 18, 2024
2 parents 3fdb8d3 + 4bbbd50 commit 7d90dcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-points-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/shopify-app-remix': patch
---

Fixes a bug that was causing external redirects to fail in remix actions
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,11 @@ function isBounceRequest(request: Request) {
}

function isDataRequest(request: Request) {
const {searchParams} = new URL(request.url);

const isGet = request.method === 'GET';
const sessionTokenHeader = Boolean(getSessionTokenHeader(request));
const sessionTokenSearchParam = searchParams.has('id_token');

return (
sessionTokenHeader &&
!sessionTokenSearchParam &&
!isBounceRequest(request) &&
(!isEmbeddedRequest(request) || !isGet)
);
Expand Down

0 comments on commit 7d90dcc

Please sign in to comment.