additional field validation #209
Replies: 1 comment 1 reply
-
I didn't quite understand why you don't prefer this solution. What do you mean by "part of the fields"?
Rodauth doesn't currently have a built-in way to add multiple validation errors, because it itself always returns a single validation error. I think the reason is that validations often have dependencies – e.g. you can't validate an account's password if the email wasn't found – and it's simpler to just always throw. If you want Rodauth to support this, I recommend asking on that repo. |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm still learning rodauth and I like it a lot, I wanted to know how to do validation correctly
how can i validate additional fields when registering, for example i need to check if the nickname field is not obscene, at the moment i can do it only in a very strange way by calling validate on the model in the hook
before_create_account
, i dont like this solution because since I can't check only part of the fields, I also don't want to write a separate controller for registering the account, maybe someone has seen a similar case and knows a better solution?how to insert errors in bulk if some fields are invalid at the same time, at the moment I did so
maybe the author or contributors know a better way?
Thanks for help
Beta Was this translation helpful? Give feedback.
All reactions