FabianLars / tauri-plugin-oauth

Apache License 2.0
84 stars 21 forks source link

Firebase authentication works in dev mode but not build #11

Open ZivFuchs opened 8 months ago

ZivFuchs commented 8 months ago

I was able to use this plugin as outlined in tauri-firebase-login to get Firebase Google redirect authentication working in dev mode, but not in build mode. My investigations found that, in build mode, the localhost redirect server was properly started and the auth token was correctly passed to the app, but when I called the Firebase SDK's signInWithCredential() function, it seemed to not do anything, and also didn't throw any errors that could be caught with .catch().

As was mentioned previously on this thread, this is likely related to authorized domains, and the fact that the domains used by the built Tauri app can't be authorized in the Firebase console.

FabianLars commented 7 months ago

Hi, thanks for reaching out. I am out of office at least until Sunday.

Until then, which OS are you using?

And do you think it's possible to create a minimal reproduction repo? I don't have much (or any) firebase experience so that would help a whole lot 🙏 Edit: of course only if you did anything different compared to the example you linked.

ZivFuchs commented 7 months ago

I'm using Ubuntu 22.04.3 LTS.

I didn't make any tweaks to the relevant functionality from the aforementioned repo so it will do for replication.

Specifically, when I run the app in dev mode, logging in causes the app to update with my user information. When in build mode, logging in doesn't seem to update anything, though the login window does show up in my browser, and my investigations in my own project revealed that the token is getting to the app properly.

FabianLars commented 7 months ago

Okay, thank you :) I will look into it once I'm back home then.