Customize registration logic
Hi, I want to change the account registration logic to provide a verification code when registering. I have the field itself added and the handling of this field done, but the problem arises when it wants to verify this code. If the user enters a code that is wrong, or the code is not assigned to his username, at that point it rejects the registration and does not make the account. Otherwise, the account should be created. I have such a code:
But this method requires returning the User model. What if the verification code validation fails? What should I do?
3 Replies
Make it so whatever is calling your function can deal with something other than the $user model being returned.
So for that you should use a middleware to redirect them to confirm the code until the code has been validated and the session access cleared.
What's the reason of that code during registration? Why don't you just use
->emailVerification()
feature on the panel?