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

Replace username with nickname, remove profileUrl, add accountId #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions lib/passport-bitbucket/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ exports.parse = function(json) {

var profile = {};
profile.id = json.uuid;
profile.accountId = json.account_id
profile.displayName = json.display_name;
profile.username = json.username;
profile.profileUrl = json.links.html.href;
profile.nickname = json.nickname;

return profile;
};
4 changes: 2 additions & 2 deletions lib/passport-bitbucket/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ util.inherits(Strategy, OAuth2Strategy);
*
* - `provider` always set to `bitbucket`
* - `id` the user's Bitbucket uuid
* - `username` the user's Bitbucket username
* - `accountId` the user's Atlassian account id
* - `nickname` the user's Bitbucket nickname
* - `displayName` the user's full name
* - `profileUrl` the URL of the profile for the user on Bitbucket
*
* @param {String} accessToken
* @param {Function} done
Expand Down
6 changes: 3 additions & 3 deletions test/strategy-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ vows.describe('BitbucketStrategy').addBatch({
} \
], \
"user": { \
"username": "jaredhanson", \
"nickname": "jaredhanson", \
"first_name": "Jared", \
"last_name": "Hanson", \
"avatar": "https://secure.gravatar.com/avatar/6c43616eef331e8ad08c7f90a51069a5?d=identicon&s=32", \
"resource_uri": "/1.0/users/jaredhanson" \
"resource_uri": "/2.0/users/jaredhanson" \
} \
}';

Expand All @@ -123,7 +123,7 @@ vows.describe('BitbucketStrategy').addBatch({
},
'should load profile' : function(err, profile) {
assert.equal(profile.provider, 'bitbucket');
assert.equal(profile.username, 'jaredhanson');
assert.equal(profile.nickname, 'jaredhanson');
assert.equal(profile.displayName, 'Jared Hanson');
assert.equal(profile.name.familyName, 'Hanson');
assert.equal(profile.name.givenName, 'Jared');
Expand Down