Skip to content

Commit 993438b

Browse files
committed
Fix signin/signout/registration/etc user form redirects
Turbo prevented the redirects to be working, and nothing happened from the users point of view when successfully submitting forms. This change disables turbo so all redirects work as should.
1 parent cb528e2 commit 993438b

7 files changed

Lines changed: 8 additions & 10 deletions

File tree

app/views/account_deletions/new.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
p This will detach all your emails and delete your login methods. Archive data remains.
66
p This action is permanent.
77

8-
= form_with url: account_deletion_path, method: :post, data: { turbo_confirm: "This cannot be undone. Type DELETE to confirm." } do
8+
= form_with url: account_deletion_path, method: :post, data: { turbo: false } do
99
.form-group
1010
= label_tag :confirmation, "Type DELETE to confirm"
1111
= text_field_tag :confirmation, nil, required: true, placeholder: "DELETE"

app/views/layouts/application.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ html data-theme="light"
5454
- if current_user&.primary_alias
5555
span.nav-user = current_user.primary_alias.name
5656
= link_to "Settings", settings_path, class: "nav-link"
57-
= button_to "Sign out", session_path, method: :delete, class: "nav-link", form: { style: 'display:inline' }
57+
= button_to "Sign out", session_path, method: :delete, class: "nav-link", form: { style: 'display:inline' }, data: { turbo: false }
5858
- else
5959
= link_to "Sign in", new_session_path, class: "nav-link"
6060
= link_to "Register", new_registration_path, class: "nav-link"

app/views/passwords/edit.html.slim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
h1 Set a new password
22

3-
= form_with url: password_path, method: :patch do
3+
= form_with url: password_path, method: :patch, data: { turbo: false } do
44
= hidden_field_tag :token, @raw
55
.field
66
= label_tag :password
@@ -10,4 +10,3 @@ h1 Set a new password
1010
= password_field_tag :password_confirmation
1111
.actions
1212
= submit_tag 'Update password'
13-

app/views/passwords/new.html.slim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
h1 Reset password
22

3-
= form_with url: password_path, method: :post do
3+
= form_with url: password_path, method: :post, data: { turbo: false } do
44
.field
55
= label_tag :email
66
= email_field_tag :email
77
.actions
88
= submit_tag 'Send reset link'
9-

app/views/registrations/new.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ h1 Register
22

33
p Enter your email. If it's in the archive, we'll verify and attach it. Otherwise, we'll create a new alias.
44

5-
= form_with url: registration_path, method: :post do |f|
5+
= form_with url: registration_path, method: :post, data: { turbo: false } do |f|
66
.field
77
= label_tag :email
88
= email_field_tag :email, nil, required: true, placeholder: "you@example.com"

app/views/sessions/new.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
h1 Sign in
22

3-
= form_with url: session_path, method: :post, local: true do |f|
3+
= form_with url: session_path, method: :post, local: true, data: { turbo: false } do |f|
44
.field
55
= label_tag :email
66
= email_field_tag :email

app/views/settings/show.html.slim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
.settings-section
1717
h2 Change password
18-
= form_with url: update_current_password_path, method: :patch, local: true do
18+
= form_with url: update_current_password_path, method: :patch, local: true, data: { turbo: false } do
1919
- if current_user.password_digest.present?
2020
.form-group
2121
= label_tag :current_password, "Current password"
@@ -50,7 +50,7 @@
5050

5151
.settings-section
5252
h2 Email addresses
53-
= form_with url: emails_path, method: :post, local: true, class: "email-form" do |f|
53+
= form_with url: emails_path, method: :post, local: true, class: "email-form", data: { turbo: false } do |f|
5454
.form-group
5555
= f.label :email, "Add email"
5656
= f.email_field :email, required: true, placeholder: "user@example.com"

0 commit comments

Comments
 (0)