Supabase auth with OAuth, in Popup instead of Options page?

Is it possible to do supabase auth, with 3rd party oauth provider, in popup page instead of options page?
10 Replies
lab
lab•12mo ago
@nami.w can you clarify what you mean by popup? There's the default popup, and there's a window.create "popup" Either way, it's possible you just need to configure the callback to send user back to a tab page you control:
lab
lab•12mo ago
Plasmo Docs
Tab Pages – Plasmo
Learn how to use tab pages with Plasmo to create new tab views in your browser extension.
N W
N W•12mo ago
@louisgv thanks for the reponse. By "popup" I mean the small window when you click on the extension's icon in toolbar (default popup.tsx) . I want to know if it's possible to do an oauth redirection without opening any new tabs/pages.
YAGPDB.xyz
YAGPDB.xyz•12mo ago
Gave +1 Rep to @louisgv
lab
lab•12mo ago
You can try to potentially open an iframe inside the popup, which do all the SSE auth flow then trickling up an access token. It might be flaky tho because if the user happens to click outside the popup, all state is gone and you will need to reset, OR you can try keeping track of the auth state in storage, then send that as a state arg to the auth flow. It's possible but seems convoluted to me.
N W
N W•9mo ago
@louisgv Thanks for the tip. Apparently it's quite possible for firebase-auth+google-as-provider (https://www.plasmo.com/blog/posts/firebase-chrome-extension). I want to ask is it possible to achieve similar experiences with say supabase-auth+non-google-provider? If no, is that because chrome extension api does something special for google identity provider?
Arcane
Arcane•9mo ago
@nami.w has reached level 1. GG!
YAGPDB.xyz
YAGPDB.xyz•9mo ago
Gave +1 Rep to @louisgv
lab
lab•9mo ago
If no, is that because chrome extension api does something special for google identity provider
Yeah - the oauth API on chrome is designed specifically to integrated with signed in chrome profile, which is linked directly with google identity I think you can try a custom non-firebase setup with just google identity and see if it works/sync similar to firebase
N W
N W•9mo ago
right but I hate to lock users into google identity 😦 Thanks for the insight anyway!
Want results from more Discord servers?
Add your server
More Posts