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

Update for Dataporten closing #3580 #3608

Merged
merged 7 commits into from
Jun 22, 2016
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/rocketchat-custom-oauth/custom_oauth_server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,16 @@ class CustomOAuth

if identity?.CharacterID and not identity.id
identity.id = identity.CharacterID


# Fix Dataporten having 'user.userid' instead of 'id'
if identity?.user.userid and not identity.id
identity.id = identity.user.userid
identity.email = identity.user.email

# Fix general 'userid' instead of 'id' from provider
if identity?.userid and not identityid
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't identityid be identity.id?

identity.id = identity.userid

# console.log 'id:', JSON.stringify identity, null, ' '

serviceData =
Expand All @@ -135,7 +144,7 @@ class CustomOAuth
serviceData: serviceData
options:
profile:
name: identity.name or identity.username or identity.nickname or identity.CharacterName
name: identity.name or identity.username or identity.nickname or identity.CharacterName or identity.user.name
Copy link
Member

@rodrigok rodrigok Jun 22, 2016

Choose a reason for hiding this comment

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

Can you protect the code replacing identity.user.name by identity.user?.name?

Copy link
Author

Choose a reason for hiding this comment

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

`identity.user?.nameoridentity.user?.name?``

Copy link
Member

Choose a reason for hiding this comment

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

identity.user?.name

Copy link
Author

Choose a reason for hiding this comment

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

Done! :)


# console.log data

Expand Down