• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ion Auth username issue


I am new to this forum and still pretty new to CodeIgniter, so I hope to fond some new knowledge here Smile

We are developing an application which needs a scalable login system and we have chosen Ion Auth because it integrates easily in CodeIgniter.
Ths first test works, but what I find annoying is that there is no input field "login name" while there is a loginname field in the database.
It appears that in the create_user() model method, the username is formed by concatenating the first name and the last name, lowercased and separated by a space:
$username = strtolower($this->input->post('first_name')) . ' ' . strtolower($this->input->post('last_name'));

While this works, it is not what I wanted. Most Web site use a separate username which is used for logging in and is not bound to the actual first and last name of the user. Besides, a space separated loginname is not very intuitive as a login credential.

Of course the code can be reworked by modifying model and controller functions but I wonder why this is designed this way right now and if people have noticed and mayben even solved this issue before.

I don't use Ion Auth but it's docs show that the username should probably be called 'full name'. In this case you want to configure ION Auth to use Email as the identity column.


$config['identity']             = 'email';     // A database column which is used to login with


I think if you have Username set as the identity column, then users can log in using their full name instead.

I would as you suggest just overload the function OR, just make it your own and change the username field to input.

Thanks for your reply, for now we have chosen to use the email address as the only login credential, and drop the username field. We just use a screenname field to show when the user has logged in.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.