의 : https://github.com/mondora/asteroid-oauth-mixin이소행성의 Oauth loginServiceConfiguration : '구글'나는 프로젝트 README에서 '순진'구현을 따랐습니다
의 예에서 내 코드의 유일한 차이점은의 전통에있는 화살표 기능을 변화를 이것의 사용법.
asteroid.ddp.on("added", ({collection, id, fields}: { collection: string; fields: {}, id: string }) => {
if (collection === "meteor_accounts_loginServiceConfiguration") {
asteroid.loginServiceConfiguration = {
...asteroid.loginServiceConfiguration,
[id]: {
_id: id,
...fields
}
};
}
});
});
asteroid.getServiceConfig = function(providerName: string) { // ts file
return this.loginServiceConfiguration[providerName];
}
내가 asteroid.loginWith을 수행 할 때 ('구글') 나는 또한 meteor add accounts-base accounts-google
를 설치 한 유성 백엔드에
index.ts:50 Uncaught TypeError: Cannot read property 'google' of undefined
나는이 종속성 가정하기 때문이다.
무엇이 누락 되었습니까? 감사! 코드 조각이있는 위의 오류를 해결하지만 새로운 오류를 생성하기 전에
나는 DDP.loginServiceConfiguration = {}
를 추가하는 시도했습니다. 내가 실행할 때
asteroid-oauth-mixin.js:787 Uncaught TypeError: Cannot read property 'clientId' of undefined
at getOauthClientId (asteroid-oauth-mixin.js:787)
at Object.getOptions (asteroid-oauth-mixin.js:720)
at Asteroid.loginWith (asteroid-oauth-mixin.js:104)
at LoginForm../src/routes/accounts/auth/LoginForm.tsx.LoginForm.handleLoginWithGoogle (
또한
meteor mongo
db.meteor_accounts_loginServiceConfiguration.find().count()
0되어야 하는가?