Skip to content

Commit 8f9cf1e

Browse files
committed
profileDecorator backward compatibility with deprecation warning.
1 parent e553712 commit 8f9cf1e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/actions/auth.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ export const createUserProfile = (dispatch, firebase, userData, profile) => {
126126
if (isFunction(config.profileFactory)) {
127127
profile = config.profileFactory(userData, profile)
128128
}
129+
if (isFunction(config.profileDecorator)) {
130+
if (isFunction(console.warn)) { // eslint-disable-line no-console
131+
console.warn('profileDecorator is Depreceated and will be removed in future versions. Please use profileFactory.') // eslint-disable-line no-console
132+
}
133+
profile = config.profileDecorator(userData, profile)
134+
}
129135
// Check for user's profile at userProfile path if provided
130136
return database()
131137
.ref()

0 commit comments

Comments
 (0)