Skip to content

[FIX] Accounts from LinkedIn OAuth without name#6590

Merged
engelgabriel merged 3 commits into
developfrom
hotfix/linkedin-names
Apr 4, 2017
Merged

[FIX] Accounts from LinkedIn OAuth without name#6590
engelgabriel merged 3 commits into
developfrom
hotfix/linkedin-names

Conversation

@rodrigok
Copy link
Copy Markdown
Member

@rodrigok rodrigok commented Apr 4, 2017

@RocketChat/core

I removed the migration for Real Names cuz it takes hours to run on our demo, we are working to fix that.

@rodrigok rodrigok added this to the 0.55.0 milestone Apr 4, 2017
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6590 April 4, 2017 17:03 Inactive
Comment thread server/startup/migrations/v091.js Outdated

RocketChat.models.Users.find(query, {'services.linkedin.firstName': 1, username: 1}).forEach((user) => {
const name = `${ user.services.linkedin.firstName } ${ user.services.linkedin.lastName }`;
console.log(name);
Copy link
Copy Markdown
Member

@sampaiodiego sampaiodiego Apr 4, 2017

Choose a reason for hiding this comment

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

I think this console.log can be removed =)

Comment thread server/lib/accounts.js
if (options.profile) {
if (options.profile.name) {
user.name = options.profile.name;
} else if (options.profile.firstName && options.profile.lastName) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can it happen to have the firstName but not the lastName?

If so, it would be better to split the if in two so the user will got at least the firstName

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Non of our 500+ cases had only firstName, but I'll change

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-6590 April 4, 2017 17:56 Inactive
@rodrigok rodrigok had a problem deploying to rocket-chat-pr-6590 April 4, 2017 17:58 Failure
@engelgabriel engelgabriel merged commit a8a4673 into develop Apr 4, 2017
@engelgabriel engelgabriel deleted the hotfix/linkedin-names branch April 4, 2017 18:21
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.

3 participants