I am using CodeIgniter. Now I have integrated Ion auth in CodeIgniter but I am facing the problem that how to log in with both Username and Email but ion auth accept only at a time with one identity to log in with Username OR Email. How to login with both username and email.
You have first goto ion_auth_model and search login function in ion_auth_model and you will see this line.
$query = $this->db->select($this->identity_column .", ".$extraSelect.', email, id, password,active, last_login')
Add username into this line
$query = $this->db->select($this->identity_column .", ".$extraSelect.', username, email, id, password,active, last_login')
After this add or_where() clause
->where($this->identity_column, $identity)
->or_where('username',$identity)
->limit(1)
->order_by('id', 'desc')
->get($this->tables['users']);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With