내 로컬 Horizion 서버에서 인증되지 않은 컬렉션에 액세스하려고합니다.Horizion.io 공용 읽기 액세스가 가능한 컬렉션
는 여기가 요청을 얼마나
다음[collections.developerProfiles]
[collections.users]
[groups.default.rules.read_public_profile]
template = "collection('developerProfiles').find({id: any()})"
[groups.authenticated.rules.store_message]
template = "collection('developerProfiles').store({id: any(), comments: any(), score: any()})"
[groups.default.rules.read_current_user]
template = "collection('users').find({id: userId()})"
가 내 schema.toml이다. 처리되지 않은 오류 : 오류 : 인증되지 않은 연결이 허용되지 않습니다 여기
const ProfileCollection = _horizon('developerProfiles');
ProfileCollection.find({
id: 'someId'
}).fetch().subscribe(collection => {
console.log('collection', collection);
})
소켓을 통해 오류입니다.
내 질문 : 왜 인증은 인증 된 경우에만 작동합니까? 기본 규칙을 정의 할 때? 내가 여기서 무엇을 놓치고 있는지.
헤이 카를로스, 그냥 몇 가지 실행 테스트. 'ProfileCollection.find'를 unauthenticated로 실행하려고 할 때 당신의 dev 콘솔에 "Operation not permitted"출력이 나오는지 확인하는 것뿐입니다. – dalanmiller
다음 오류가 발생합니다. auth.js : 171Uncaught 오류 : 토큰을 사용하여 인증하려고 시도했지만 토큰이 존재하지 않습니다. 요청한 리소스가 공개이어야하므로 별다른 문제가 없습니다. –
도움이된다면 @ horizon/client와의 반응을 사용하고 있습니다. 문서의 모든 권한을 시도한 것 같습니다. –