jeudi 21 septembre 2017

Start Firebase in php

Helle all,

I want to start my web site with Firebase but I think I miss something. For my test I have juste one page.

var config = {
    apiKey: "xxxxxxxxxxxxxxxxxxx",
    authDomain: "xxxxxxxxx.firebaseapp.com",
    databaseURL: "http://ift.tt/1F7P61K",
    projectId: "xxxxxx",
    storageBucket: "xxxxxx.appspot.com",
    messagingSenderId: "xxxxxxxxxxxx"
};
firebase.initializeApp(config);

firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
    var errorCode = error.code;
    var errorMessage = error.message;
    if (errorCode == 'auth/weak-password') {
        alert('The password is too weak.');
    } else {
        alert(errorMessage);
    }
    console.log(error);
});

I have an error

Failed to load http://ift.tt/2xgvWJm: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'xxxxxxxxxxxxxxxxxxxxxxx' is therefore not allowed access. The response had HTTP status code 404.

Do you have an idea ?

Ps : I am on an online IDE, codeanywhere

Thanks




Aucun commentaire:

Enregistrer un commentaire