Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Auth + Electron = failure?

I'm trying to get firebase auth working with electron. I already have it working with iOS and Android and would like to use the same for the desktop version of the app.

What I'm mainly trying with is the google sign in. Using firebase's web version ends up with a failure where localhost isn't accepted for signing in. I have tried the node.js version of the code but I can't get that working either.

Google this: https://www.google.com/search?q=firebase+auth+electron

And you'll see all I have tried and all stackoverflow questions I have looked through. Some people say they have it working but I have found no working examples. Is this a lost cause or could someone point me in the right direction?

A lot of people seems to have the same issue but no answers.

like image 232
just_user Avatar asked Apr 09 '26 10:04

just_user


1 Answers

you will have to set nativeWindowOpen to true inside webPreferences in your main windows. Like so:

mainWindow = new BrowserWindow(
        {
            width: 1280,
            height: 720,
            webPreferences: {
                nodeIntegration: false,
                preload: path.join(__dirname, 'preload.js'),
                nativeWindowOpen: true
            }
        }
);
like image 84
Towfiq Avatar answered Apr 12 '26 07:04

Towfiq