Hey everyone, what is the "Supabase-endorsed" way ...
# supabase-kt
s
Hey everyone, what is the "Supabase-endorsed" way of checking whether a user has already signed up with a certain email-address? Currently this seems to be a big discussion throughout all the SDK implementations (https://github.com/orgs/supabase/discussions/1282, ...) and implementations also seem to differ wildly ranging from copying the auth.user table content/emails to a public one (which I would really like to avoid) to using edge functions to query the auth.users table. I understand the security implications and why this approach has been chosen, but the trade-off on UX-flows is also pretty heavy so I'm very surprised there's not a clear alternative or mitigation offered.
j
Well as you already said, there is no straight-forward way and the described solutions seem to be the only options. The easiest might be to check the user identities after sign up, but I'm not sure if that still works:
Copy code
val user = supabase.auth.signUpWith(Email) {
    //...
}
if(user.identities != null && user.identities.isNotEmpty()) {
   //New user
} else {
   //Sign up failed
}
👍 1