Skip to content

Conversation

@blazerunner44
Copy link
Contributor

This is a quick fix for an issue discussed on PR #329

It appears Shopify now issues the iss field on Checkout UI session tokens, breaking the current determineTokenSource method.

This PR removes the iss field check and relys solely on the presence of the sid field to determine if the SessionToken comes from the app or checkout ui.

According to the Shopify documentation, they define the sid as:
sid: A unique session ID per user and app.
Shopify docs

Therefore, it makes sense that a sid wouldn't be issued for a checkout/account UI extension as there's no authenticated Shopify user using the app.

Copy link
Contributor

@jeroendelau jeroendelau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, but does this pass the tests? Probably they also need a small edit.

@Kyon147
Copy link
Owner

Kyon147 commented Oct 16, 2025

@blazerunner44 thanks for the PR, I've kicked off the tests but can you confirm this is backwards compatible in your testing?

Copy link
Owner

@Kyon147 Kyon147 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good for now - the docs look like they are still out of date https://shopify.dev/docs/api/checkout-ui-extensions/latest/apis/session-token but as you say it does assume that checkout extension do not have a sid

@Kyon147 Kyon147 merged commit 9854480 into Kyon147:master Nov 7, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants