Skip to content

Commit 7bedcfa

Browse files
authored
Merge pull request #10 from emq/crystal_0.25_fix
Crystal 0.25 fix
2 parents 8b2deaa + 2ede282 commit 7bedcfa

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

shard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: multi_auth
2-
version: 0.1.0
2+
version: 1.0.0
33

44
authors:
55
- Sergey Makridenkov <s@msa7.ru>
66

7-
crystal: 0.23.0
7+
crystal: 0.25.0
88

99
license: MIT
1010

src/multi_auth/providers/google.cr

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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

src/multi_auth/version.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module MultiAuth
2-
VERSION = "0.1.0"
2+
VERSION = "1.0.0"
33
end

0 commit comments

Comments
 (0)