の「グーグル:例から自分のコードで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];
}
私は、これは、依存関係であると仮定ので、私はまたmeteor add accounts-base accounts-google
をインストール流星のバックエンドでasteroid.loginWith( 'グーグル')
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すべきですか?