Provider Signup with custom user data

Hey there! I am trying to implement a way for my users to authenticate with google, discord, etc. My app uses usernames to display, which I decided to store in the users themselves (in the user_meta_data). When signing up with Email and Password, this is not a problem, as I can pass the additional data (the username which was entered), so it automatically gets stored.

Now to my problem: When a user tries to sign up with google, I cannot send the username with it. This is because for OAuth, we have to use client.auth.signIn instead of client.auth.signUp (see https://github.com/supabase/supabase/discussions/1226).

The problem is client.auth.signIn does not accept any data to be passed along. And even if it did, I do not want to override the username if the user was already registered before.

How would I go about this problem?
Was this page helpful?