Couldn't you move this to the top of the function so we don't have to do any of the OAuth logic?