Hi all, I am storing users’ usernames in a profiles table separate from auth and want to check on signup whether a username is unique or not. I thought I could do this via database functions instead of edge functions. But I’m unsure how to set it up w/ Weweb workflows at the moment.
the function name must be the same when you are inputting the “Function name option” for the rest, it’s not required.
I don’t quite understand what’s going on in your arguments. If your postgres function is called checkUsernameAvailability then you just set it as Function name (you already did that) and for arguments, you just do username and bind [username variable]. No need to call all that JS, you’re basically already doing that by using the workflow action, the workflow action is the equivalent of that JS you have there.
I’m gonna assume your function is called check_username_availability, then this is the setup you need to do
Then I have created an edge function to create users without being kicked out of the app as is default following this (whch will work as is copy pasted if you want)