Skip to content

Commit 8e5b3d7

Browse files
author
Scott Prue
committed
fix(profile): only include providerData if it is not an empty array in Firestore - #699
1 parent 72f90c6 commit 8e5b3d7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/actions/auth.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,10 @@ export const createUserProfile = (dispatch, firebase, userData, profile) => {
271271
}
272272

273273
// Convert custom object type within Provider data to a normal object
274-
if (isArray(newProfile.providerData)) {
274+
if (
275+
isArray(newProfile.providerData) &&
276+
newProfile.providerData.length
277+
) {
275278
newProfile.providerData = newProfile.providerData.map(
276279
providerDataItem =>
277280
pick(providerDataItem, config.keysToPreserveFromProviderData)

0 commit comments

Comments
 (0)