2017-04-10 7 views
1

私が開発していたときにブラウザでセッションが開始されたため、GoogleやFacebookのようなプロバイダから再度ログインする必要がなかったため、いつ起きたのか分かりません。新しいユーザーが私のWebアプリケーションにログインしようとしたとき、彼女はエラーがあったと私に言った。そこでブラウザのデータを消去し、ブラウザがGoogleまたはFacebookログインのポップアップを開こうとすると、A network error (such as timeout, interrupted connection or unreachable host) has occurred.というメッセージが表示され始めました。 SafariやAndroid Chromeでは発生しません。Firebaseの認証がクロムで動作していない

ここに参考用のコードスニペットがあります。

<!-- 
@license 
Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 
Code distributed by Google as part of the polymer project is also 
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 
--> 

<link rel="import" href="../bower_components/polymer/polymer.html"> 
<link rel="import" href="../bower_components/paper-button/paper-button.html"> 
<link rel="import" href="../bower_components/polymerfire/polymerfire.html"> 
<link rel="import" href="shared-styles.html"> 

<dom-module id="my-view1"> 
    <template> 
    <style include="shared-styles"> 
     :host { 
     display: block; 

     padding: 10px; 
     } 
    </style> 

    <div class="card"> 
     <div class="circle">1</div> 
     <paper-button on-tap="login">Login</paper-button > 
     <h1>View One</h1> 
     <p>Ut labores minimum atomorum pro. Laudem tibique ut has.</p> 
     <p>Lorem ipsum dolor sit amet, per in nusquam nominavi periculis, sit elit oportere ea.Lorem ipsum dolor sit amet, per in n# 
    </div> 
    </template> 

    <script> 
    Polymer({ 
     is: 'my-view1', 

     login: function(){//{{{ 
     firebase.initializeApp({ 
      apiKey: apiKey, 
      authDomain: authDomain, 
      databaseURL: databaseURL 
     }); 

     var provider = new firebase.auth.FacebookAuthProvider(); 
     firebase.auth().signInWithPopup(provider).then(function(result){ 
      console.log(result); 
     }).catch(function(error){ 
      console.error(error); 
     }); 
     },//}}} 
    }); 
    </script> 
</dom-module> 

答えて

0

誰かがログインする前にアプリを初期化する必要があります。

firebase.initializeApp({ 
    apiKey: apiKey, 
    authDomain: authDomain, 
    databaseURL: databaseURL 
}); 

誰かがページ上に着陸するときは、いつでもこれを行うのに最適な場所です。

+0

ナーですね。私はそれをテストした。 –

0

私はchrome://settings/content/cookiesに行きました。をすべて削除しました。をすべて削除してください。それは私のためにそれを固定した。

関連する問題