omniauth-galvanize 0.4.10 → 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 420a9f4678d8b96f0f59b309364158ee1dff0cd5
4
- data.tar.gz: d664fd92c21afdce16e8abe6fd791c21b9e9f5e3
3
+ metadata.gz: 686b79292789db3eee4b9a60fac9ebe875ac103a
4
+ data.tar.gz: cb7d632aa488ce09af88287e94643984f51b3f97
5
5
  SHA512:
6
- metadata.gz: 29b7a1249c9219dfc1341f199314bea66e34bcd0b4fcf5e3d17a304b315c96a3cbbc307a2e7a8805661338f668515e33530687da1ac6d9bd150b9c79c7b86462
7
- data.tar.gz: 726c7c58bab6149d4e94e78e5deffb95d72e493b1f55ad770e8d52de1580a8828057526ce3b2a6abea50bb02a9d81e2d061dd7c731a4c82832fab274ef2c6390
6
+ metadata.gz: 984272d6605dcc3c9a8d840f29c235229dc6c44a336e7781781c16733d79e713d96a66b06baf1dba28056dad505e0f3113912458bbcf0eabb6bea4c66284a5da
7
+ data.tar.gz: 81646da54e66664d573e353627d6cdccea44bcdc1d8f14f63c8e2169ae4945e648047c1442873fa272bcffb9e83a59f014984816a2175862bd17f0abbf39a510
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Galvanize
3
- VERSION = "0.4.10"
3
+ VERSION = "0.4.11"
4
4
  end
5
5
  end
@@ -8,6 +8,7 @@ module OmniAuth
8
8
  option :name, 'galvanize_developer'
9
9
  option :fields, [:first_name, :last_name, :email, :role, :cohorts, :galvanize_id, :home_location]
10
10
  option :role_fields, [:role]
11
+ option :cohort_fields, [:cohort]
11
12
  option :uid_field, :galvanize_id
12
13
 
13
14
  def request_phase
@@ -25,13 +26,18 @@ module OmniAuth
25
26
 
26
27
  info do
27
28
  roles_array = []
29
+ cohorts_array = []
28
30
  options.fields.inject({}) do |hash, field|
29
31
  if options.role_fields.include?(field)
30
32
  roles_array << {name: request.params[field.to_s], description: "The description for #{field.to_s}"} unless request.params[field.to_s].blank?
33
+ elsif options.cohort_fields.include?(field)
34
+ cohorts_array << {name: request.params[field.to_s]} unless request.params[field.to_s].blank?
31
35
  else
32
36
  hash[field] = request.params[field.to_s]
33
37
  end
38
+
34
39
  hash[:roles] = roles_array
40
+ hash[:cohorts] = cohorts_array
35
41
  hash
36
42
  end
37
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-galvanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Cunningham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2015-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth