Xano Payload Error Message Question

I’m currently working on authentication with Xano. Xano throws what seems to be a generic message back to WeWeb if the email already exists. The field is set as a unique index so it won’t allow duplicates. I’m probably going about this the wrong way but my function stack queries the user table for emails that match the email input field. It create a variable from this true/false based on records found. I then have a precondition set that creates an error based on this variable. My question is how to I get this error message or payload back to WeWeb so I can essentially generate a user already exists error message on the front end?

Hi,
If you check the “auth/signup” endpoint, it has a pre-condition to check if the user already exists based on the email input and returns:

{“code”:“ERROR_CODE_ACCESS_DENIED”,“message”:“This account is already in use.”}

If user exists. You can use same type of condition and apply to your new pre condition and grab the “message” part of the response.

If you need more dynamic, you can also use the status code to identify the error. If user exists the status code will be 403. So if status = 200, all good and process is fine, if status 403, something went wrong and you can display the “message” part into a weweb variable and show an alert section.

You can also filter that part of the new error message into the response in XANO and set apart to show:

As you can see in the user auth, it has 2 responses, you can always add a third “Email check” for example and use a weweb variable to display.

Hope not being too confusing :slight_smile: .