Updated login process and updated the user model.