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

Commit 98cfafc

Browse files
committed
Merge pull request #450 from appirio-tech/feature/SUP-1967-social-registration-fix
fixing social registration problem
2 parents 9ca2aab + 88c6f76 commit 98cfafc

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

app/account/register/register.controller.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,21 @@
9898

9999
vm.socialRegister = function(provider) {
100100
TcAuthService.socialRegistration(provider, null)
101-
.then(function(socialData) {
102-
vm.socialUserId = socialData.socialUserId;
103-
vm.username = socialData.username;
104-
vm.firstname = socialData.firstname;
105-
vm.lastname = socialData.lastname;
106-
vm.email = socialData.email;
107-
vm.isSocialRegistration = true;
108-
vm.socialProfile = socialData.socialProfile;
109-
vm.socialProvider = socialData.socialProvider;
110-
vm.socialContext.accessToken = socialData.socialaccessToken;
101+
.then(function(resp) {
102+
if (resp.status === 'SUCCESS') {
103+
var socialData = resp.data;
104+
vm.socialUserId = socialData.socialUserId;
105+
vm.username = socialData.username;
106+
vm.firstname = socialData.firstname;
107+
vm.lastname = socialData.lastname;
108+
vm.email = socialData.email;
109+
vm.socialProfile = socialData.socialProfile;
110+
vm.socialProvider = socialData.socialProvider;
111+
vm.socialContext= {'accessToken': socialData.accessToken};
112+
vm.isSocialRegistration = true;
113+
} else {
114+
vm.isSocialRegistration = false;
115+
}
111116
})
112117
.catch(function(result) {
113118
switch (result.status) {

app/services/tcAuth.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
} else {
155155
$log.error('Unsupported social login provider: ' + provider);
156156
reject({
157-
status: "failed",
157+
status: "FAILED",
158158
"error": "Unsupported social login provider '" + provider + "'"
159159
});
160160
}

0 commit comments

Comments
 (0)