Login username or password.
I want customers to login via "email" on the frontend and the admins to login via "username" on the backend (/admin page)
I came up with this solution:
In the users table there will be two fields, username and email.
If the customer try to login on the frontend, it will check their email, password and group_id = 0
For admin, it will check their username on group_id = 2
Is this the correct way?