make user_id optional as it is not a attribute for devise user

devise user has no user_id attribute, so here I just make user_id check optional, if user_id is not defined, use email instead.