Add login logic to User model