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

feat: optionally return all raw email addresses for user #4

Merged
merged 2 commits into from Feb 7, 2019

Conversation

Projects
None yet
2 participants
@jaredscheib
Copy link
Collaborator

jaredscheib commented Feb 6, 2019

Adopted in part from jaredhanson#27


if (self._allRawEmails) {
profile.emails = json.map(function (email) {
var mappedEmail = Object.assign(email, { value: email.email });

This comment has been minimized.

@ultrabluewolf

ultrabluewolf Feb 6, 2019

How do you know which email is the primary one? Should we add type to these? See: http://www.passportjs.org/docs/profile/

This comment has been minimized.

@jaredscheib

jaredscheib Feb 6, 2019

Author Collaborator

here's a sample json object:

[ { primary: true,
    verified: true,
    visibility: 'private',
    value: 'bob.pineapple@gmail.com' },
  { primary: false,
    verified: true,
    visibility: null,
    value: 'pineapple@users.noreply.github.com' },
  { primary: false,
    verified: true,
    visibility: null,
    value: 'bob@pineapple.com' } ]

This comment has been minimized.

@ultrabluewolf

ultrabluewolf Feb 6, 2019

Ah, is this what the response looks like? [ { "email": "octocat@github.com", "verified": true, "primary": true, "visibility": "public" } ]

This comment has been minimized.

@ultrabluewolf

ultrabluewolf Feb 6, 2019

Cool, sounds good.

This comment has been minimized.

@jaredscheib

jaredscheib Feb 6, 2019

Author Collaborator

yep, exactly

This comment has been minimized.

@jaredscheib

jaredscheib Feb 6, 2019

Author Collaborator

my map just transforms these objects to have a value key, which seems to be a convention across passport addons

This comment has been minimized.

@ultrabluewolf

ultrabluewolf Feb 6, 2019

Should we add a test then?

This comment has been minimized.

@jaredscheib

jaredscheib Feb 7, 2019

Author Collaborator

added tests!

@ultrabluewolf
Copy link

ultrabluewolf left a comment

LGTM, but it would be great to add a test as well.

@ultrabluewolf
Copy link

ultrabluewolf left a comment

:shipit:

@jaredscheib jaredscheib merged commit b39119d into master Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment