move identity authentication to user model