Improved login with password hashing