Is there a hook or way I can check the registration code on the front end on a stand alone page?
Use case: We have a user landing page where the user is going to enter in a registration code. Some JS will then call a hook to check if the code is valid or not. The user is then redirected to the registration page or an error page.
Comments
Comment #2
rpsuThere is no hook or readymade API to talk to to verify code, however the code itself is in the configuration and creating such API (route and callback) is not difficult.
The thing is the code is sometimes calculated with other information (such as user's email on the registration form), and in those cases API will never be able to return good results if only the code is checked.
Another thing is that providing such API will expose Regcode to brute force attacks, so even if the user's email and code would be fetched perhaps small sleep (1-2 s) would be good to have there to make brute forcing harder.
User registration form's validation checks are here:
https://git.drupalcode.org/project/regcode_simple/-/blob/8.x-1.x/regcode...