Quasar Firebase.onAuthStateChanged() main.js Problem #8841
Unanswered
HoussamEljamal
asked this question in
General - Components / Directives / etc
Replies: 1 comment
-
Taken from Discord #firebase channel (I know noting about FB) -> this goes into a Quasar boot file: import firebaseService from '../services/firebase'
export default ({ app, store }) => {
const config = process.env.environments.FIREBASE_CONFIG
firebaseService.fBInit(config)
// Auth
firebaseService.auth().onAuthStateChanged((user) => {
firebaseService.handleOnAuthStateChanged(store, user)
}, (error) => {
console.error(error)
})
app.config.globalProperties.$fb = firebaseService
store.$fb = firebaseService
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hello guys am studying vue3 udemy course and i cant find any solution on how to use this code inside quasar app, in the main.js he use the below code in vue3 cli generated app
import { createApp } from "vue";
import App from './App.vue'
import router from './router'
import './assets/main.css'
import { projectAuth } from "./firebase/config";
let app
projectAuth.onAuthStateChanged( () => {
if (!app) {
app = createApp(App)
.use(router)
.mount('#app')
}
})
Beta Was this translation helpful? Give feedback.
All reactions