Login with Ion Auth both Username and Email Login with Ion Auth both Username and Email codeigniter codeigniter

Login with Ion Auth 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']);