Add authenticate class method to User model