Hey!
I have set up my custom auth for firebase in my login popup, which when I register users onto the database works perfectly. but when I attempt to read/write using the setUserValue&getUserValue controls my log shows I am not authenticated?
I use a popup login screen on app launch for auth, how would I tie this in to my homepage to allow the auth to work across the entire app?
I’m struggling to link the FirebaseDatabase on my homepage to connect to the customconfig in my loging popup page
below is my homepage code. I would like the authentication to be maintained across the app as there will more than one page in the navigation which needs the authentication to function.
Thanks!!!
import Felgo 3.0
import QtQuick 2.0
import Felgo 3.0
Page {
id: mainPage
title: "Home"
signal logoutClicked()
signal registrationRequired
function logoutUser() {
firebaseAuth.logoutUser()
}
ItemWithFirebaseLogin {
id: loginPage
opacity: 1
z: 1
visible: opacity > 0
enabled: visible
Behavior on opacity { NumberAnimation { duration: 250 } }
}
FirebaseDatabase {
id: firebaseDb
config: customConfig
onReadCompleted: {
if(success) {
console.debug("Read Value " + value + " for key" + key)
} else {
console.debug("Error: " + value)
}
output.text = value
}
onWriteCompleted: {
if(success) {
console.debug("Successfully wrote to DB")
output.text = "Successfully wrote to DB"
} else {
console.debug("Write failed with error: " + message)
output.text = "Write failed with error: " + message
}
}
onRealtimeUserValueChanged: {
output.text = value
}
}
}