Skip to content

Commit

Permalink
fix(user): fix social auth
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbeau committed Apr 20, 2018
1 parent 37b9f0a commit 43ea63d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/user/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,14 @@ export class User {

const callback = (res) => {
res.setEncoding('utf8');
res.on('data', function(d) {
const data = JSON.parse(d);

let dataStr= '';
res.on('data', (chunk) => {
dataStr += chunk;
});

res.on('end', () => {
const data = JSON.parse(dataStr);
if (data && !data.error) {
observer.next(data);
} else {
Expand Down Expand Up @@ -706,8 +712,14 @@ export class User {

const callback = (res) => {
res.setEncoding('utf8');
res.on('data', function(d) {
const data = JSON.parse(d);

let dataStr= '';
res.on('data', (chunk) => {
dataStr += chunk;
});

res.on('end', () => {
const data = JSON.parse(dataStr);
if (data && !data.error) {
const userInfo = {
email: data.emailAddresses[0].value,
Expand Down

0 comments on commit 43ea63d

Please sign in to comment.