Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
</p>

<% if Weave::Config.configured? %>
<%= button_to "Sign in with Weave", auth_weave_path, class: "mt-6 w-full rounded bg-amber-600 px-4 py-2 font-medium text-white hover:bg-amber-700" %>
<%# Turbo off: Turbo submits with fetch, and fetch cannot follow the redirect to Weave's origin. %>
<%= button_to "Sign in with Weave", auth_weave_path, form: { data: { turbo: false } }, class: "mt-6 w-full rounded bg-amber-600 px-4 py-2 font-medium text-white hover:bg-amber-700" %>
<% else %>
<p
class="
Expand Down
8 changes: 8 additions & 0 deletions test/controllers/sessions_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
assert_includes response.body, "Sign in to Stash"
end

test "the Weave button submits without Turbo, so the browser follows the redirect to Weave" do
with_fake_weave do
get sign_in_path

assert_select "form[action=?][data-turbo=false]", auth_weave_path
end
end

test "the Weave flow signs a person with a role in" do
with_fake_weave do
post auth_weave_path
Expand Down
Loading