Skip to content

fix(sessions): submit the weave sign-in without turbo so the redirect works - #4

Merged
jaspermayone merged 1 commit into
mainfrom
fix/weave-sign-in-turbo
Nov 9, 2026
Merged

jaspermayone merged 1 commit into
mainfrom
fix/weave-sign-in-turbo

Conversation

@jaspermayone

Copy link
Copy Markdown
Member

Why

On stash.patchworklabs.org and stash-staging, "Sign in with Weave" does nothing. The logs show POST /auth/weave with format turbo_stream and a 302 to Weave. Turbo submits the form with fetch, and fetch cannot follow a redirect to another origin, so the browser stays on the sign-in page.

What

  • app/views/sessions/new.html.erb: the button's form has data-turbo="false". The browser posts the form itself and follows the 302 to Weave. The CSRF token is still in the form.
  • test/controllers/sessions_controller_test.rb: a test checks the attribute on the form.
sequenceDiagram
  participant B as Browser
  participant S as Stash
  participant W as Weave
  B->>S: POST /auth/weave (full page, no Turbo)
  S-->>B: 302 to Weave /oauth/authorize
  B->>W: GET /oauth/authorize
  W-->>B: 302 to /auth/callback
Loading

The sign-in button is the only place that starts the Weave redirect. Sign-out and expired sessions go to /sign_in, which is the same origin.

Checks

bin/rails test (60 runs, 0 failures), rubocop and herb lint pass. An adversarial review found no issue in the fix.

@jaspermayone
jaspermayone merged commit aab7a6d into main Nov 9, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant