Commit 6d6a4a3567ab00158907e47044a1c971136af8c9

Authored by Jérémy Lecour
1 parent 54fcbb97
Exists in master and in 1 other branch production

use only integers for org ids

Actually, using "native" integers works too, and seems simpler.
app/controllers/users/omniauth_callbacks_controller.rb
... ... @@ -8,8 +8,8 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
8 8 # See if they are a member of the organization that we have access for
9 9 # If they are, automatically create an account
10 10 client = Octokit::Client.new(access_token: github_token)
11   - org_ids = client.organizations.map { |org| org.id.to_s }
12   - if org_ids.include?(github_org_id.to_s)
  11 + org_ids = client.organizations.map { |org| org.id }
  12 + if org_ids.include?(github_org_id)
13 13 github_user = User.create(name: env["omniauth.auth"].extra.raw_info.name, email: env["omniauth.auth"].extra.raw_info.email)
14 14 end
15 15 end
... ...