Better documentation for `EnsureAuthenticatedLinks`?
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.9k
- Forks
- 739
- Avg merge
- 21h 2m
- Merged PRs (30d)
- 1
Description
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
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. - Is
EnsureAuthenticatedLinksrequired for Turbo / TurboLinks if we already get the token viaapp-bridge.js -> shopify.idToken();and pass it via XHR requests? - Does
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)?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with docs/shopify_app/controller-concerns.md and the existing EnsureAuthenticatedLinks and EnsureHasSession references. Read the concern entry points and related configuration mentioned in the issue, then document when each concern is used, their ordering, Turbo or TurboLinks considerations, and embedded_redirect_url usage. Done means the documentation answers the three listed questions with verified examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- backend, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100