Bug: OmniAuth redirect_uri hardcoded to Tailscale hostname — public domain login fails #246
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
Related to
ldraney/landscaping-assistant #224(config.hosts + Keycloak redirect URIs for public domain).Repo
ldraney/landscaping-assistantWhat Broke
When accessing the app via
https://landscaping-assistant.app, clicking "Sign in" redirects to Keycloak with the wrongredirect_uri:Instead of:
The Keycloak login page renders, credentials can be entered, but after authentication Keycloak redirects back to the Tailscale hostname — so the public domain session is never established. The user appears unauthenticated on
landscaping-assistant.app.Repro Steps
https://landscaping-assistant.appredirect_uripointing tolandscaping-assistant.tail5b443a.ts.net, notlandscaping-assistant.applucas-super-admin/Test1234!)Expected Behavior
The OmniAuth
redirect_urishould match the host the user is accessing from. When accessed vialandscaping-assistant.app, the callback should behttps://landscaping-assistant.app/auth/keycloak/callback.Environment
landscaping-assistantnamespace)https://landscaping-assistant.app(public domain via Hetzner edge proxy)landscapinglandscaping-assistantRoot Cause (Likely)
The OmniAuth Keycloak initializer hardcodes the callback URL or base URL to the Tailscale hostname. It needs to dynamically resolve based on the incoming request's
Hostheader, or use OmniAuth'sfull_host/redirect_urioption to respect the current domain.Acceptance Criteria
landscaping-assistant.appproducesredirect_uriwithlandscaping-assistant.appvalid_redirect_urisincludeshttps://landscaping-assistant.app/auth/keycloak/callbackRelated
project-landscaping-assistant— project this affectsldraney/landscaping-assistant #224— config.hosts + Keycloak redirect URIs ticket (in validation)ldraney/pal-e-platform #434— Caddy reverse proxy config (in validation)ldraney/landscaping-assistant #231— HostAuthorization fix (done)Scope Review: READY
Review note:
review-1478-2026-06-17Ticket is well-scoped with verified file targets and complete traceability. Root cause confirmed:
config/initializers/omniauth.rbline 28 hardcodes Tailscale hostname asENV.fetchfallback default. All 4 acceptance criteria are concrete and agent-verifiable. Single-file fix, no decomposition needed. Ready for implementation.