Skip to content

Commit 2e31a6c

Browse files
committed
Disable Turbo for omniauth links
When Turbo is enabled for these links, the CSP directive changes to `connect-src` (due to the JavaScript fetch). However, since we are leaving CodeHarbor anyway, we just disable Turbo and thus prevent any Turbo-related issues.
1 parent ecd1d7b commit 2e31a6c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/views/users/registrations/edit.html.slim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
a.btn.btn-light.btn-sm.mb-2.me-2.disabled href='#'
8989
= t('.cannot_remove_last_identity', kind: provider_name)
9090
- else
91-
= button_to(t('.add_identity', kind: provider_name), omniauth_authorize_path(resource_name, provider), class: 'btn btn-light btn-sm mb-2 me-2', method: :post)
91+
= button_to(t('.add_identity', kind: provider_name), omniauth_authorize_path(resource_name, provider), class: 'btn btn-light btn-sm mb-2 me-2', method: :post, data: {turbo: false})
9292

9393
.form-group.py-3
9494
.btn-group role='group'

app/views/users/shared/_links.html.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@
2424
= button_to(t('devise.shared.links.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)),
2525
omniauth_authorize_path(resource_name, provider),
2626
class: 'btn btn-link p-0 border-0',
27-
method: :post)
27+
method: :post,
28+
data: {turbo: false})

0 commit comments

Comments
 (0)