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

Commit ff6bd80

Browse files
author
vikasrohit
committed
Merge pull request #360 from appirio-tech/feature/bitbuket-ext-acc-support
Feature/bitbuket ext acc support
2 parents d53ca49 + 2f6c34b commit ff6bd80

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

app/directives/external-account/external-account.directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{ provider: "behance", className: "fa-behance", displayName: "Behance", disabled: true, order: 2, colorClass: 'el-behance'},
88
// { provider: "google-oauth2", className: "fa-google-plus", displayName: "Google+", disabled: true, order: }, colorClass: 'el-dribble',
99
{ provider: "github", className: "fa-github", displayName: "Github", disabled: false, order: 1, colorClass: 'el-github'},
10-
{ provider: "bitbucket", className: "fa-bitbucket", displayName: "Bitbucket", disabled: true, order: 7, colorClass: 'el-bitbucket'},
10+
{ provider: "bitbucket", className: "fa-bitbucket", displayName: "Bitbucket", disabled: false, order: 7, colorClass: 'el-bitbucket'},
1111
{ provider: "twitter", className: "fa-twitter", displayName: "Twitter", disabled: true, order: 4, colorClass: 'el-twitter'},
1212
{ provider: "weblinks", className: "fa-globe", displayName: "Web Links", disabled: true, order: 8, colorClass: 'el-weblinks'}
1313
// TODO add more

app/directives/external-account/external-link-data.directive.jade

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@
7575
.value {{(account.data.followers|number:0) || 0}}
7676
.key followers
7777
li
78-
//- {{(account.data.repositories|number:0) || 0}}
79-
.value TBD
78+
.value {{(account.data.repos|number:0) || 0}}
8079
.key repositories
8180

8281
div(ng-switch-when="twitter")

app/services/externalAccounts.service.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
accessToken: socialData.accessToken
100100
}
101101
};
102+
if (socialData.accessTokenSecret) {
103+
postData.context.accessTokenSecret = socialData.accessTokenSecret;
104+
}
102105
$log.debug("link API postdata: " + JSON.stringify(postData));
103106
var api = ApiService.restangularV3;
104107
api.one('users', user.userId).customPOST(postData, "profiles", {}, {})

app/services/helpers.service.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
socialProviderId = '';
3838

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

4142
if (socialProvider === 'google-oauth2') {
4243
firstName = profile.given_name;
@@ -88,8 +89,10 @@
8889
}
8990

9091
var token = accessToken;
92+
var tokenSecret = null;
9193
if (profile.identities && profile.identities.length > 0) {
9294
token = profile.identities[0].access_token;
95+
tokenSecret = profile.identities[0].access_token_secret;
9396
}
9497
return {
9598
socialUserId: socialUserId,
@@ -99,7 +102,8 @@
99102
email: email,
100103
socialProfile: profile,
101104
socialProvider: socialProvider,
102-
accessToken: token
105+
accessToken: token,
106+
accessTokenSecret : tokenSecret
103107
}
104108
}
105109

0 commit comments

Comments
 (0)