Skip to content

Social login in web extensions #5787

Discussion options

You must be logged in to vote

@connorlindsey yes, you need to use chrome.identity.launchWebAuthFlow

Basically, you need to create an extension redirect uri (by calling the chrome.identity.getRedirectURL()) method and add that to your supabase auth settings list of urls.
That fetches you a bunch of stuff including access_token, refresh_token, etc. Use the refresh_token and invoke supabase.auth.signIn() with that.

Here's a sample login function for reference.

You can obviously make a React hook by wrapping this inside a useEffect and adding some loading, error states and whatnot.

Hope this helps you guys out! ✌️

Replies: 5 comments 20 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@wd021
Comment options

@der-ofenmeister
Comment options

@connorlindsey
Comment options

@DennisKo
Comment options

Answer selected by thorwebdev
Comment options

You must be logged in to vote
10 replies
@cguagenti
Comment options

@henningko
Comment options

@connorlindsey
Comment options

@henningko
Comment options

@connorlindsey
Comment options

Comment options

You must be logged in to vote
4 replies
@kyegomez
Comment options

@kyegomez
Comment options

@Henry-Pulver
Comment options

@remusris
Comment options

Comment options

You must be logged in to vote
2 replies
@abhishekmg
Comment options

@malay9418
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet