replace field id by email for local auth