I have recently developed an e-commerce website and completed the registration process with email and password.
Now, I am looking to store user information such as email, full name, and timestamp in the database.
The screenshot below shows that I can view the user data in the Google Chrome Dev Console. https://i.sstatic.net/PTL3h.png
However, upon checking the Firebase database via the browser, I noticed that the user ID appears as undefined instead of the actual user ID.
https://i.sstatic.net/GLMI7.png
Currently, I am at step 3 of the process:
- Add user data into the database
I am facing difficulties understanding why this issue is occurring and would appreciate any assistance you can provide.
Here is a snippet from my store/index.js file:
import fireApp from '@/plugins/firebase'
export const state = () => ({
user: null,
error: null,
busy: false,
jobDone: false
})
export const mutations = {
setUser (state, payload) {
state.user = payload
},
setError (state, payload) {
state.error = payload
},
clearError (state, payload) {
state.error = null
},
setBusy (state, payload) {
state.busy = payload
},
setJobDone (state, payload) {
state.jobDone = payload
},
}
...
// Rest of the content remains unchanged
...