Skip to content

Configuration siteName is required #15

@ghost

Description

Hi,
for a few days I can't log in with facebook and email any more. But the funny thing is; signing in with google works.

Am I doing something wrong?

Error

screen shot 2016-06-13 at 11 59 59

Code

App.js

"use strict";

// Init firebase
export const Firebase = firebase.initializeApp({
  apiKey: "api-key-here",
  authDomain: "auth-domain-here",
  databaseURL: "database-url-here",
  storageBucket: "storage-bucket-here"
});

Auth.jsx

"use strict";

import { Accounts } from "meteor/accounts-base";

import React, { Component, PropTypes } from "react"
import { browserHistory } from "react-router"
import { createContainer } from "meteor/react-meteor-data"

import { Firebase } from "../../../App.js"

class Auth extends Component {
  componentDidMount() {
    // Init firebase auth ui config
    const authUiConfig = {
      "signInSuccessUrl": "/",
      signInOptions: [
        firebase.auth.GoogleAuthProvider.PROVIDER_ID,
        firebase.auth.FacebookAuthProvider.PROVIDER_ID,
        firebase.auth.EmailAuthProvider.PROVIDER_ID
      ],
      tosUrl: "tos-url-goes-here",
      callbacks: {
        signInSuccess: function (currentUser, credential, redirectUrl) {
          return false; // Do not redirect automatically
        }
      }
    };

    Firebase.auth().onAuthStateChanged(((user) => {
      if (user && Meteor.loggingIn() === false) {
        // Login via firebase
        user.getToken().then(((token) => {
          Accounts.callLoginMethod({ methodArguments: [{ firebaseToken: token }] });
          this.props.history.push("/");
        }).bind(this));
      } else if (user === null) {
        // Show auth ui
        const FirebaseAuthUi = new firebaseui.auth.AuthUI(Firebase.auth());
        FirebaseAuthUi.start("#firebaseui-auth-container", authUiConfig);
      }
    }).bind(this));
  }

  render() {
    return (
        <div className="ui center aligned grid">
          <div class="column">
            <div id="firebaseui-auth-container"></div>
          </div>
        </div>
    )
  }
}

Auth.propTypes = {
  history: PropTypes.object.isRequired
};

export default createContainer(() => {
  return {
    history: browserHistory
  };
}, Auth)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions