Had a little bit of fun with this. I don't really know Code Igniter so I've tried my best to dig out the best practices.
Moved validation rules into the dedicated Validation config file. This will help to avoid noise in the User controller.
Added a validation group for the user login form.
When failing to log in, ensure the name field doesn't reset itself.
The login method had a bit of repetition going on so I reworked the structure.
Login form errors are presented in the same style as the registration form.
I've tested on my local. Required a bit of work to set up as I had to guess your data structure for the database. If you don't mind me giving a helping hand I can do more of these. I'd like to help out by getting some documentation in place for other contributors, including migrations/seeds in order to get going quickly.
Had a little bit of fun with this. I don't really know Code Igniter so I've tried my best to dig out the best practices.
I've tested on my local. Required a bit of work to set up as I had to guess your data structure for the database. If you don't mind me giving a helping hand I can do more of these. I'd like to help out by getting some documentation in place for other contributors, including migrations/seeds in order to get going quickly.