jaredhanson/passport-windowslive

emails not added to profile

Closed this issue · 1 comments

The scope 'wl.emails' will send the emails as followed:

 emails:
  { preferred: 'roel.van.uden@hotmail.com',
    account: 'roel.van.uden@hotmail.com',
    personal: null,
    business: null },

But they are not on the profile object.

// Set the e-mail addresses.
profile.emails = profile.emails === undefined ? [] : profile.emails;
// Check if an account e-mail is available.
if (profile._json.emails.account) {
    // Push the account e-mail.
    profile.emails.push({value: profile._json.emails.account, type: 'other'});
}
// Check if a personal e-mail is available.
if (profile._json.emails.personal) {
    // Push the personal e-mail.
    profile.emails.push({value: profile._json.emails.personal, type: 'home'});
}
// Check if an business e-mail is available.
if (profile._json.emails.business) {
    // Push the business e-mail.
    profile.emails.push({value: profile._json.emails.business, type: 'work'});
}

And a work around.

Implemented support as of passport-windowslive v0.1.3.