Replies: 1 comment 5 replies
-
Can you find places in Rodauth's code where it would use such a method? If not, I don't think Rodauth should ship with such a method. It's easy to add yourself, either directly or as a custom feature, should you need it. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
(To help make discussion easier, here is the code for all 3 methods, extracted out for easier viewing:
)
I have been working on coding my own custom validation logic in a
before_create_account
block. I started with the sample code at http://rodauth.jeremyevans.net/rdoc/files/doc/guides/registration_field_rdoc.html (both examples usethrow_error_status(status, field, error)
, which I see basically adds athrow_error(field, error)
call vs the code forset_response_error_status
.Because I have my own custom validation logic, I actually do my own
set_field_error
errors... and because I actually validate all of the fields at once, I am not doingthrow_error_status(status, field, error)
... which would onlyset_field_error
for one field, before throwing.My solution has been to basically do this at the end after all the validation (assuming errors were encountered):
It appears that the throw is essential based on testing... or else account creation would carry on. So my question is, is there utility for a
set_error_response
+throw :rodauth_error
method? I do not see anything like that in the methods provided.Beta Was this translation helpful? Give feedback.
All reactions