Password logic for user model