Commit 54fcbb9704bf027d83f9bd69f38ec455c2ccedd3
1 parent
ee62fe94
Exists in
master
and in
1 other branch
github_org_id can't match (String vs. Integer)
The user's organization ids are converted to String, but the configuration value `Errbit::Config.github_org_id` is always an Integer. They can't possibly match. By converting the config's value to a String, it works. There might be a better solution by using Integers all the way,
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/controllers/users/omniauth_callbacks_controller.rb
... | ... | @@ -9,7 +9,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController |
9 | 9 | # If they are, automatically create an account |
10 | 10 | client = Octokit::Client.new(access_token: github_token) |
11 | 11 | org_ids = client.organizations.map { |org| org.id.to_s } |
12 | - if org_ids.include?(github_org_id) | |
12 | + if org_ids.include?(github_org_id.to_s) | |
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 | ... | ... |