Fix production 404: add login page for OmniAuth POST requirement #151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/login-page-redirect"
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?
Summary
authenticate_user!redirected toGET /auth/keycloak, but OmniAuth 2.x only accepts POST — 404 on every protected route in production/loginpage with POST form button, sprout icon, taglineis-loginbody classChanges
app/controllers/application_controller.rb: redirect tologin_pathinstead of/auth/keycloakapp/controllers/sessions_controller.rb: addnewaction for login pageconfig/routes.rb: addGET /loginrouteapp/views/sessions/new.html.erb: new login page with icon, tagline, POST button, flash alertapp/views/layouts/application.html.erb: addis-loginbody class for sessions#newapp/assets/stylesheets/application.css: login page styles, hide chrome on loginspec/requests/sessions_spec.rb: add login page specs, update assertion textspec/requests/{crew,person,role_access,feature_flags}_spec.rb: update redirect expectations to/loginTest Plan
/loginwithout authentication/auth/keycloakcorrectly/auth/keycloakto/loginReview Checklist
Related Notes
ldraney/landscaping-assistant #149— follow-up spike for smoke tests and observabilityproject-landscaping-assistantReview — PR #151
Verdict: APPROVED
Core fix
Correct.
redirect_to login_pathreplaces the brokenredirect_to "/auth/keycloak", allow_other_host: true. The/loginpage usesbutton_towithmethod: :post, which generates a proper POST form — exactly what OmniAuth 2.x requires.Route
get "/login", to: "sessions#new", as: :loginplaced correctly in the auth section.skip_before_action :authenticate_user!onSessionsControllerensures no redirect loop.View
Clean ERB. Inline SVGs for the sprout icon and login arrow match the nav icon style.
data: { turbo: false }on the button is correct — OmniAuth handles its own redirect chain outside Turbo.Layout
is-loginbody class viacontroller_name == 'sessions' && action_name == 'new'is a clean conditional. CSS hides auth-bar and bottom-nav rather than server-side conditional — acceptable tradeoff (simpler code, no layout duplication).CSS
Follows design system: tokens for colors, spacing, radius. Component section header follows the convention. Two minor notes (non-blocking):
box-shadowuses hardcodedrgba(37, 99, 235, ...)— no shadow token exists, so this is acceptablemin-height: 85vhfor centering is appropriate for a full-page loginTests
/auth/keycloakto/loginacross 4 spec filesNo issues found