code changes around passport authentication