diff --git a/Gemfile b/Gemfile index 1833ee0b..38b52e87 100644 --- a/Gemfile +++ b/Gemfile @@ -97,3 +97,5 @@ group :development, :test do end gem "webpacker", "~> 5.2" + +gem "omniauth-rails_csrf_protection", "~> 1.0" diff --git a/Gemfile.lock b/Gemfile.lock index f3708ba4..d432728f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -327,6 +327,9 @@ GEM omniauth-oauth (1.2.0) oauth omniauth (>= 1.0, < 3) + omniauth-rails_csrf_protection (1.0.0) + actionpack (>= 4.2) + omniauth (~> 2.0) omniauth-tumblr (1.2) multi_json omniauth-oauth (~> 1.0) @@ -596,6 +599,7 @@ DEPENDENCIES mini_magick newrelic_rpm omniauth + omniauth-rails_csrf_protection (~> 1.0) omniauth-tumblr omniauth-twitter pg diff --git a/app/views/settings/_services.haml b/app/views/settings/_services.haml index be9c7493..ebec715c 100644 --- a/app/views/settings/_services.haml +++ b/app/views/settings/_services.haml @@ -7,7 +7,7 @@ - APP_CONFIG['sharing'].each do |service, service_options| - if service_options['enabled'] && @services.none? { |x| x.provider == service.to_s } - %p= link_to t('views.settings.service.connect', service: service.capitalize), "/auth/#{service}" + %p= link_to t('views.settings.service.connect', service: service.capitalize), "/auth/#{service}", method: :post - if @services.count.positive? %ul.list-group