Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include 'name' in info hash as that is required field of omniauth #38

Merged
merged 1 commit into from
Jun 19, 2020
Merged

include 'name' in info hash as that is required field of omniauth #38

merged 1 commit into from
Jun 19, 2020

Conversation

btalbot
Copy link
Contributor

@btalbot btalbot commented Jun 18, 2020

include 'name' in info hash as that is required field of omniauth schema. minor refactor of extra hash contents.

Also prune out keys with null (or empty) values as most other omniauth providers do and seems to be a good practice. For 'extra' hash, split details into their own hash for 'id_info' and 'user_info' so it's clear where the values come from and common keys do not clobber each other. Add raw 'id_token' to extra as well as it's sometimes useful for troubleshooting and is added by other providers.

…chema. minor refactor of `extra` hash contents.

Also prune out keys with null (or empty) values as most other omniauth providers do and seems to be a good practice. For 'extra' hash, split details into their own hash for 'id_info' and 'user_info' so it's clear where the values come from and common keys do not clobber each other. Add raw 'id_token' to extra as well as it's sometimes useful for troubleshooting and is added by other providers.
@btalbot
Copy link
Contributor Author

btalbot commented Jun 18, 2020

OmniAuth schema https://github.com/omniauth/omniauth/wiki/Auth-Hash-Schema#schema-10-and-later

Comment on lines +117 to +122
def prune!(hash)
hash.delete_if do |_, v|
prune!(v) if v.is_a?(Hash)
v.nil? || (v.respond_to?(:empty?) && v.empty?)
end
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nhosoya nhosoya merged commit 029d59f into nhosoya:master Jun 19, 2020
@btalbot btalbot deleted the fix-auth-info branch June 19, 2020 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants