Skip to content

Instantly share code, notes, and snippets.

@douglascorrea
Created June 6, 2016 15:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascorrea/003ae6a6b11f19c97d6ee5b28d0d9eef to your computer and use it in GitHub Desktop.
Save douglascorrea/003ae6a6b11f19c97d6ee5b28d0d9eef to your computer and use it in GitHub Desktop.
transformFirebaseUser
function transformFirebaseUser(firebaseUser) {
const storeUser = {};
const userProperties = [
'displayName',
'email',
'emailVerified',
'isAnonymous',
'photoURL',
'providerData',
'providerId',
'refreshToken',
'uid',
'isAdmin'
];
userProperties.map((prop) => {
if (prop in firebaseUser) {
storeUser[prop] = firebaseUser[prop];
}
});
return storeUser;
}
@ninjasort
Copy link

Cool, thanks!

@imjared
Copy link

imjared commented Jun 28, 2016

+1, thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment