Skip to content

Commit

Permalink
Merge pull request #10 from emq/crystal_0.25_fix
Browse files Browse the repository at this point in the history
Crystal 0.25 fix
  • Loading branch information
msa7 authored Jul 4, 2018
2 parents 8b2deaa + 2ede282 commit 7bedcfa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: multi_auth
version: 0.1.0
version: 1.0.0

authors:
- Sergey Makridenkov <[email protected]>

crystal: 0.23.0
crystal: 0.25.0

license: MIT

Expand Down
8 changes: 5 additions & 3 deletions src/multi_auth/providers/google.cr
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ class MultiAuth::Provider::Google < MultiAuth::Provider

private def primary?(field)
field = json[field]?
return nil if field.nil?
field.each do |item|
return unless field

field.as_a.each do |item|
return item if item["metadata"]["primary"].as_bool?
end

nil
end

Expand Down Expand Up @@ -101,7 +103,7 @@ class MultiAuth::Provider::Google < MultiAuth::Provider
user.phone = primary("phoneNumbers")["canonicalForm"].as_s if primary?("phoneNumbers")
user.description = primary("biographies")["value"].as_s if primary?("biographies")

json["urls"].each do |url|
json["urls"].as_a.each do |url|
urls = {} of String => String
urls[url["type"].as_s] = url["value"].as_s

Expand Down
2 changes: 1 addition & 1 deletion src/multi_auth/version.cr
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MultiAuth
VERSION = "0.1.0"
VERSION = "1.0.0"
end

0 comments on commit 7bedcfa

Please sign in to comment.