Overview/summary
Hi,
The current documentation for EnsureAuthenticatedLinks is really sparse. It simply says "Designed to be more of a lightweight session concern specifically for XHR requests. Where EnsureHasSession does far more than just session management, this concern will redirect to the splash page of the app if no active session was found."
Can you please elaborate on it to add instructions on how to use it? For example:
- I assume
EnsureAuthenticatedLinks goes in AuthenticatedController, but is it required to come after include ShopifyApp::EnsureHasSession or is it not even needed if EnsureHasSession is included? For example, we noticed that having EnsureAuthenticatedLinks come before EnsureHasSession causes AbstractController::DoubleRenderError.
- Is
EnsureAuthenticatedLinks required for Turbo / TurboLinks if we already get the token via app-bridge.js -> shopify.idToken(); and pass it via XHR requests?
- Does
config.embedded_redirect_url in shopify_app.rb need to be set as well? If so, what should it be set to? Is it supposed to be set to root_path or path that gets the token via app-bridge.js -> shopify.idToken(); (i.e. SplashPageController)?
Overview/summary
Hi,
The current documentation for
EnsureAuthenticatedLinksis really sparse. It simply says "Designed to be more of a lightweight session concern specifically for XHR requests. Where EnsureHasSession does far more than just session management, this concern will redirect to the splash page of the app if no active session was found."Can you please elaborate on it to add instructions on how to use it? For example:
EnsureAuthenticatedLinksgoes inAuthenticatedController, but is it required to come afterinclude ShopifyApp::EnsureHasSessionor is it not even needed ifEnsureHasSessionis included? For example, we noticed that havingEnsureAuthenticatedLinkscome beforeEnsureHasSessioncausesAbstractController::DoubleRenderError.EnsureAuthenticatedLinksrequired for Turbo / TurboLinks if we already get the token viaapp-bridge.js -> shopify.idToken();and pass it via XHR requests?config.embedded_redirect_urlinshopify_app.rbneed to be set as well? If so, what should it be set to? Is it supposed to be set toroot_pathor path that gets the token viaapp-bridge.js -> shopify.idToken();(i.e.SplashPageController)?