This logic should not live in the controller. Move to user model.