Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Firebase Auth State Persistence ELECTRON loadFILE vs loadURL

I have a functioning electron app and I'd like to load a url from another site (created by me for the app). The trouble I'm having is persisting the login when I loadURL from the main process in Electron.

I am successfully maintaining auth state status between various local html files within electron (using separate JS files) so I am assuming the issue is related to loadURL vs loadFILE on a new html file. Currently I'm testing using a localhost port for the other URL (the one not reading Auth State).

I use the following code to detect the state change:

let extConfig = {
  apiKey: "myKEY",
  authDomain: "fcf-appdestination.com",
  databaseURL: "https://fcf-appdestination.com",
  projectId: "fcf-app",
  storageBucket: "fcf-app-bucket",
  appId: "1:APPID",
}
const fbApp = firebase.initializeApp(extConfig);

firebase.auth().onAuthStateChanged((user) => {
    if(user){
      currentUser = user.uid
    } 
  })

What's frustrating is when I navigate to the prior working page (via a button triggering a loadFile event in the main process in Electron) the auth state persists and the user is logged in.

Am I not able to persist the firebase auth state in the way I'd like?

Thank you,

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found the answer here: Is there any way to keep a person authenticated with firebase across subdomains

You need to use a server function to create a custom token as an admin and send the token to the subdomain to use for login.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!