Skip to content

Commit

Permalink
Update email to always return and give verified status
Browse files Browse the repository at this point in the history
  • Loading branch information
zquestz committed Mar 7, 2019
1 parent 5b9af0d commit efe0e90
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Changelog
All notable changes to this project will be documented in this file.

## 0.6.1 - 2019-03-07

### Added
- Return `email` and `email_verified` keys in response.

### Deprecated
- Nothing.

### Removed
- Nothing.

### Fixed
- Nothing.

## 0.6.0 - 2018-12-28

### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/omniauth/google_oauth2/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module OmniAuth
module GoogleOauth2
VERSION = '0.6.0'
VERSION = '0.6.1'
end
end
7 changes: 2 additions & 5 deletions lib/omniauth/strategies/google_oauth2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def authorize_params
info do
prune!(
name: raw_info['name'],
email: verified_email,
email: raw_info['email'],
email_verified: raw_info['email_verified'],
first_name: raw_info['given_name'],
last_name: raw_info['family_name'],
image: image_url,
Expand Down Expand Up @@ -135,10 +136,6 @@ def prune!(hash)
end
end

def verified_email
raw_info['email_verified'] ? raw_info['email'] : nil
end

def image_url
return nil unless raw_info['picture']

Expand Down

0 comments on commit efe0e90

Please sign in to comment.