Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 705fe86

Browse files
Merge pull request #96 from mena-devs/update-omniauth
Update omniauth
2 parents 25e6925 + 21ce229 commit 705fe86

File tree

6 files changed

+22
-3
lines changed

6 files changed

+22
-3
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "bundler" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ gem 'meta-tags'
3131
gem 'mini_racer'
3232
gem 'nested_form'
3333
gem 'omniauth-slack'
34+
gem 'omniauth-rails_csrf_protection'
3435
gem 'paranoia', '~> 2.2'
3536
gem 'paperclip', '~> 5.2.0'
3637
gem 'pg'

Gemfile.lock

+4
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ GEM
364364
omniauth-oauth2 (1.3.1)
365365
oauth2 (~> 1.0)
366366
omniauth (~> 1.2)
367+
omniauth-rails_csrf_protection (0.1.2)
368+
actionpack (>= 4.2)
369+
omniauth (>= 1.3.1)
367370
omniauth-slack (2.3.0)
368371
omniauth-oauth2 (~> 1.3.1)
369372
orm_adapter (0.5.0)
@@ -634,6 +637,7 @@ DEPENDENCIES
634637
meta-tags
635638
mini_racer
636639
nested_form
640+
omniauth-rails_csrf_protection
637641
omniauth-slack
638642
overcommit
639643
paperclip (~> 5.2.0)

app/views/devise/shared/_omniauthable.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<%- if devise_mapping.omniauthable? %>
22
<%- resource_class.omniauth_providers.each do |provider| %>
3-
<%= link_to(user_slack_omniauth_authorize_path) do %>
3+
<%= link_to(user_slack_omniauth_authorize_path, method: :post) do %>
44
<!-- "Sign in with #{OmniAuth::Utils.camelize(provider)}" -->
55
<%= image_tag('https://platform.slack-edge.com/img/sign_in_with_slack.png',
66
alt: 'Sign in with Slack',

config/initializers/omniauth.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Configure OmniAuth to only allow requests from :post and :get
2+
OmniAuth.config.allowed_request_methods = [:post, :get]
3+
14
if !AppSettings.slack_app_client_id.blank? && !AppSettings.slack_app_client_secret.blank?
25
Rails.application.config.middleware.use(OmniAuth::Builder) do
36
provider :slack,

spec/requests/api/users_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
response '200', 'Return verified users' do
1515
schema '$ref' => '#/components/schemas/users'
16-
16+
1717
let!(:user) { create(:user) }
1818
let!(:api_key) { create(:api_key, user: user) }
1919
let!(:user_1) { create(:user) }
@@ -90,7 +90,7 @@
9090
schema schema '$ref' => '#/components/schemas/users'
9191

9292
let!(:user) { create(:user) }
93-
let!(:member) { create(:user) }
93+
let!(:member) { create(:user, first_name: "find-user-test") }
9494
let!(:api_key) { create(:api_key, user: user) }
9595
let!("query[first_name]") { member.first_name }
9696
let(:Authorization) { 'Bearer ' + api_key.access_token }

0 commit comments

Comments
 (0)