File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : multi_auth
2- version : 0.1 .0
2+ version : 1.0 .0
33
44authors :
55 - Sergey Makridenkov <s@msa7.ru>
66
7- crystal : 0.23 .0
7+ crystal : 0.25 .0
88
99license : MIT
1010
Original file line number Diff line number Diff line change @@ -66,10 +66,12 @@ class MultiAuth::Provider::Google < MultiAuth::Provider
6666
6767 private def primary? (field )
6868 field = json[field]?
69- return nil if field.nil?
70- field.each do |item |
69+ return unless field
70+
71+ field.as_a.each do |item |
7172 return item if item[" metadata" ][" primary" ].as_bool?
7273 end
74+
7375 nil
7476 end
7577
@@ -101,7 +103,7 @@ class MultiAuth::Provider::Google < MultiAuth::Provider
101103 user.phone = primary(" phoneNumbers" )[" canonicalForm" ].as_s if primary?(" phoneNumbers" )
102104 user.description = primary(" biographies" )[" value" ].as_s if primary?(" biographies" )
103105
104- json[" urls" ].each do |url |
106+ json[" urls" ].as_a. each do |url |
105107 urls = {} of String => String
106108 urls[url[" type" ].as_s] = url[" value" ].as_s
107109
Original file line number Diff line number Diff line change 11module MultiAuth
2- VERSION = " 0.1 .0"
2+ VERSION = " 1.0 .0"
33end
You can’t perform that action at this time.
0 commit comments