So I have just setup tank auth, I have not changed anything yet so everything should be default. It works perfectly fine. However I want to require for a certain domain for emails to be able to login. For now I will say gmail. So how can i make it so it checks that the email address has @gmail.com in it before the user can register. I have found where the valid email error message is and can change that but i cannot find where the actual check for the valid email.
Share
Tank auth is using CI’s default
valid_emailvalidation rule, found in the Form Validation class.It’s definitely a strange thing to want to do, but you can create a callback validation function and add it to your form validation rules on the registration page.
This is basically the equivalent of an
ends_withrule, but adds the “@”:So create the callback function in your controller and add it to the validation: