2017-09-20 3 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]; 
} 

私は、これは、依存関係であると仮定ので、私はまた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すべきですか?

答えて

0

私はmeteor add service-configurationに設定し、私のconfigure-accounts.jsをセットアップし、アプリケーション用のgoogle clientIdを作成する必要がありました。

これは私がポップアップを持っているポイントに私を取得し、どのユーザーに認証するかを選択できます。次に、ターゲットの原点の不一致に関する新しいエラーが表示されますが、この問題は解決されたものとして終了します。

関連する問題