Welcome Guest, Not a member yet? Register   Sign In
Ion Auth username issue
#1

[eluser]Klausch[/eluser]
Hi,

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:
Code:
$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.


#2

[eluser]yacman[/eluser]
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/ion_auth.php
Code:
...

$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.
#3

[eluser]Klausch[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB