Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Feature/bitbuket ext acc support #360

Merged
merged 3 commits into from
Oct 14, 2015
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{ provider: "behance", className: "fa-behance", displayName: "Behance", disabled: true, order: 2, colorClass: 'el-behance'},
// { provider: "google-oauth2", className: "fa-google-plus", displayName: "Google+", disabled: true, order: }, colorClass: 'el-dribble',
{ provider: "github", className: "fa-github", displayName: "Github", disabled: false, order: 1, colorClass: 'el-github'},
{ provider: "bitbucket", className: "fa-bitbucket", displayName: "Bitbucket", disabled: true, order: 7, colorClass: 'el-bitbucket'},
{ provider: "bitbucket", className: "fa-bitbucket", displayName: "Bitbucket", disabled: false, order: 7, colorClass: 'el-bitbucket'},
{ provider: "twitter", className: "fa-twitter", displayName: "Twitter", disabled: true, order: 4, colorClass: 'el-twitter'},
{ provider: "weblinks", className: "fa-globe", displayName: "Web Links", disabled: true, order: 8, colorClass: 'el-weblinks'}
// TODO add more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
.value {{(account.data.followers|number:0) || 0}}
.key followers
li
//- {{(account.data.repositories|number:0) || 0}}
.value TBD
.value {{(account.data.repos|number:0) || 0}}
.key repositories

div(ng-switch-when="twitter")
Expand Down
3 changes: 3 additions & 0 deletions app/services/externalAccounts.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
accessToken: socialData.accessToken
}
};
if (socialData.accessTokenSecret) {
postData.context.accessTokenSecret = socialData.accessTokenSecret;
}
$log.debug("link API postdata: " + JSON.stringify(postData));
var api = ApiService.restangularV3;
api.one('users', user.userId).customPOST(postData, "profiles", {}, {})
Expand Down
6 changes: 5 additions & 1 deletion app/services/helpers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
socialProviderId = '';

var socialUserId = profile.user_id.substring(profile.user_id.lastIndexOf('|') + 1);
var refreshToken = null;

if (socialProvider === 'google-oauth2') {
firstName = profile.given_name;
Expand Down Expand Up @@ -88,8 +89,10 @@
}

var token = accessToken;
var tokenSecret = null;
if (profile.identities && profile.identities.length > 0) {
token = profile.identities[0].access_token;
tokenSecret = profile.identities[0].access_token_secret;
}
return {
socialUserId: socialUserId,
Expand All @@ -99,7 +102,8 @@
email: email,
socialProfile: profile,
socialProvider: socialProvider,
accessToken: token
accessToken: token,
accessTokenSecret : tokenSecret
}
}

Expand Down