Browse Source

createCustomToken returns a Promise

Same as https://github.com/firebase/functions-samples/pull/84 but for LinkedIn Auth.
issue-90
Olivier Haouchine 8 years ago
committed by GitHub
parent
commit
ff59319ad2
  1. 7
      linkedin-auth/functions/index.js

7
linkedin-auth/functions/index.js

@ -145,8 +145,9 @@ function createFirebaseAccount(linkedinID, displayName, photoURL, email, accessT
// Wait for all async task to complete then generate and return a custom auth token.
return Promise.all([userCreationTask, databaseTask]).then(() => {
// Create a Firebase custom auth token.
const token = admin.auth().createCustomToken(uid);
console.log('Created Custom token for UID "', uid, '" Token:', token);
return token;
return admin.auth().createCustomToken(uid).then((token) => {
console.log('Created Custom token for UID "', uid, '" Token:', token);
return token;
});
});
}

Loading…
Cancel
Save