encrypt users password in beforeCreate hook
Moved login functionality into user model