modified login controller to remove unused code