Auth failure and Invalid site errors after charge decline

If you don't turn force_redirect to false in app bridge, it will be
redirected to iframe.

Hey man, you have to read the sample code base. Your understanding is not
deep enough to troubleshoot
SPO - SEO App to research keywords & edit social link preview
BYOB - Build Your Own Bundles
0 Likes
seriousdev
Excursionist
15 0 1

true, my understanding is not good at the moment, as it's my first experience with this whole platform and developing my first app. I'm open to read anything that helps. Is there a link to documentation you're referring to?

Plus I'm not using Shopify app bridge anywhere. When I created the project the app-bridge code was throwing errors(this error) I couldn't find a fix anywhere for it and I did not have to use it specifically so I deleted that javascript code and then my app worked fine afterwards.

Is there a way to disable this redirect without introducing app bridge because apparently it just breaks on the very first line(tested by creating a fresh project as well and it throws the same error). Or do I need to include it to fix this issue?
The code crashes as it fails to find an html element with an id 'shopify-app-init'. There's no place where I could find about this thing and ended up deleting it, as it wasn't being used anyways.

0 Likes

You can read some docs here:

https://shopify.dev/concepts/apps/building-embedded-apps-using-session-tokens

https://shopify.dev/tutorials/authenticate-your-app-using-session-tokens

https://shopify.dev/tutorials/authenticate-with-oauth

App bridge is used by embedded apps to bypass 3rd party cookies via session token auth. It is the tool to generate the token, think of it working like the token generator hardware for logging in to your bank (common in Hong Kong). If you are developing a standalone app, App bridge is not necessary. If I don't remember wrong, App bridge must live under the Shopify portal. Otherwise, it will cause an error on the browser console.

If you're not using it, it won't cause a force redirect. 

My experience is limited to App bridge, Django, python. If your error is related to Ruby (like wrong routing), I've no knowledge in this area.

SPO - SEO App to research keywords & edit social link preview
BYOB - Build Your Own Bundles
0 Likes

The code crashes as it fails to find an html element with an id 'shopify-app-init'.

Finally, I suggest you better utilize your IDE, just use the find-everywhere feature to find this id. My IDE atom can help me to identify this element without a few seconds. 

SPO - SEO App to research keywords & edit social link preview
BYOB - Build Your Own Bundles
0 Likes
seriousdev
Excursionist
15 0 1

@selina10261 the authentication failure error was resolved after I updated my app from Shopify partners dashboard to be a Non Embedded app. I've also set my app to be a non-embedded app in my app's config in config/initializers/shopify_app.rb file.

seriousdev
Excursionist
15 0 1

the code to generate this div is there and it is generated by default(I have not changed anything in it to make it break) but it does not render the element with that DOM id. That's is why the javascript fails to find that element and runs into a crash. However, it's crashing in a fresh generated project as well so it has nothing to do with me breaking it.

0 Likes