2017-09-20 14 views
0
정의되지 않은

의 : 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되어야 하는가?

답변

0

필자는 meteor add service-configuration으로 설정하고 configure-accounts.js를 설정하고 애플리케이션 용 google clientId를 만들었습니다.

이렇게하면 팝업이 표시되고 인증 할 사용자를 선택할 수 있습니다. 그런 다음 대상 원점 불일치에 대한 새로운 오류가 표시되지만 해결 된 것처럼이 질문을 닫습니다.