You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
login: async ({ commit, dispatch }, firebaseAuthUser) => {
// ########## ctime is the account creation timestamp. stime is the last login timestamp ########
const ctime = firebaseAuthUser.metadata.a
const stime = firebaseAuthUser.metadata.b
let user
// ########## CHECK IF THE USER LOGGED IN FOR THE FIRST TIME ########
if (ctime === stime){
user = await createNewUserFromFirebaseAuthUser(firebaseAuthUser)
} else {
const authuser = firebaseAuthUser.providerData[0]
user = {displayName:authuser.displayName , id: firebaseAuthUser.uid, email:authuser.email, photoURL:authuser.photoURL, created:ctime , lastLogin:stime}
}
commit('setUser', user)
dispatch('products/getUserProducts', null, { root: true })
}
No more useless reads , and it's faster. If someone can put a pull request for this because i didn't fork the repo
The text was updated successfully, but these errors were encountered:
The login method is badly written, everytime you login, it reads the database to check if the user has its own collection or not.
I am talking about this file
authentication.actions.js
Here is how i fixed it for me
No more useless reads , and it's faster. If someone can put a pull request for this because i didn't fork the repo
The text was updated successfully, but these errors were encountered: