Login with Ion Auth and Username and Email

I am using CodeIgniter. Now I have enabled Ion auth in CodeIgniter, but I am facing a login problem with both username and email, but with ion authentication, only authorize once to login with username or email by mail. How to login with username and email.

+3


source to share


1 answer


You have your first ion_auth_model function and search 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 to this line



$query = $this->db->select($this->identity_column .", ".$extraSelect.', username, email, id, password,active, last_login')

      

After that add the clause or_where ()

->where($this->identity_column, $identity)
->or_where('username',$identity)
->limit(1)
->order_by('id', 'desc')
->get($this->tables['users']);

      

+4


source







All Articles