Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/actions/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export const watchUserProfile = (dispatch, firebase) => {
}

/**
* @description Create user profile if it does not already exist. `updateProifleOnLogin: false`
* can be passed to config to dsiable updating. Profile factory is applied if it exists and is a function.
* @description Create user profile if it does not already exist. `updateProfileOnLogin: false`
* can be passed to config to disable updating. Profile factory is applied if it exists and is a function.
* @param {Function} dispatch - Action dispatch function
* @param {Object} firebase - Internal firebase object
* @param {Object} userData - User data object (response from authenticating)
Expand Down Expand Up @@ -260,7 +260,7 @@ export const login = (dispatch, firebase, credentials) => {
if (!userData) return Promise.resolve(null)

// For email auth return uid (createUser is used for creating a profile)
if (userData.email) return userData.uid
if (method === 'signInWithEmailAndPassword') return userData.uid
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Exactly what I was thinking.


// For token auth, the user key doesn't exist. Instead, return the JWT.
if (method === 'signInWithCustomToken') {
Expand All @@ -277,7 +277,7 @@ export const login = (dispatch, firebase, credentials) => {
}

// Create profile when logging in with external provider
const { user } = userData
const user = userData.user || userData

return createUserProfile(
dispatch,
Expand Down