Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix authenticate, remove app bridge from auth full redirect page #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enmaboya
Copy link
Contributor

@enmaboya enmaboya commented Nov 15, 2024

The problem was that App Bridge redirected the user back to Shopify before the JavaScript script had a chance to run.

In theory, after being redirected back to Shopify, our script should have executed, but since we were not yet authenticated at that moment, an error occurred.

Comment on lines 4 to 9
<meta charset="utf-8">
<base target="_top">
<meta name="shopify-api-key" content="{{ \Osiset\ShopifyApp\Util::getShopifyConfig('api_key', $shopDomain ?? Auth::user()->name ) }}"/>
<script src="https://cdn.shopify.com/shopifycloud/app-bridge.js"></script>

<title>Redirecting...</title>

Choose a reason for hiding this comment

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

why do we need this view? it works if we make the redirect from the controller without using the view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I mentioned in the issue, there is no difference; both options will likely work the same way.

However, someone might be using this view to send analytics via sendBeacon or for something else. I can't make any definitive statements here.

Personally, I don't use the authenticate route at all—it's not necessary during a token exchange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants