SupabaseS
Supabase2mo ago
Sebas

No Custom Auth Hook

I want to create a custom Auth hook for my DB and I was under the impression I could. However I noticed one can only create a hook based on the ones present in the screenshot attached.

My use case is as follows (with some omissions for simplicity):
  • I have a DB table with 2 columns: email(text) and allowed (boolean)
  • When a user wishes to sign up both through Google or password, I want to check whether he is allowed
  • If there is no record with the email -> Send error A so the FE can send user on path A
  • If the email exists on the table with allowed: false -> Send error B so the FE can send user on path B
  • If the email exists on the table with allowed: true -> Allow signup
Which of the possible restricted list of hooks is more suitable for this? Does it even matter which <hook_name> I choose if the SQL hook will not be written like the docs?
image.png
Was this page helpful?