You should probably dogfood your product more.
At thirdsouth.capital, we own seven different software products. This means that our team is constantly hitting the max number of google accounts you can sign into at any one time. Fun!
Privacy matters to our users. And we don't want to create our own authentication service. So, we instead outsource everything to Google.
But we had a slight issue. Clipboard History Pro was using Firebase's built-in authentiction method, firebase.auth.GoogleAuthProvider()
, but we were not able to let users select which Google Account they wanted to sign into.
Instead, our extension would default to your most recent Google Account. Now this is fine for 90% of users who have a single google account, but there are many sickos out there (like us!) who use multiple.
This created a problem where if you were a pro user, you were not able to use our extension properly, unless you signed out of all the google accounts you are using, except for the one that is connected to your pro account.
firebase.auth.GoogleAuthProvider()
actually does have a built-in way to select your account. You can pass customOAuthParameters
like prompt select_account
, but for some reason this wasn't working for us.
We decided it was probably easier to flip to the chrome-native identity.launchWebAuthFlow
, which allows us to use Chrome's built in APIs and gives us more control in how we handle authentication.
And now our users can easily select which google account they want to sign into.
