I'm looking to slowly launch an app and I want to allow Google login for ease-of-use but I only want to allow this if a supabase admin has manually added the user in the supabase dashboard beforehand. Currently using @supabase/ssr in nextjs v14 to do Google oAuth.
Basically, I only want to allow the supabase.auth.exchangeCodeForSession() function to run if a user is found in the auth.users table that matches the Google email that is attempting to signup.
Any ideas for this? Is there a way I could do this with pg functions? Or is there a way to decode the Google email from the code challenge that Google sends as a searchParam after redirect?