49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import Axios from "axios";
|
|
|
|
$(document).ready(function () {
|
|
|
|
M.AutoInit();
|
|
//initialize all modals
|
|
$('.modal').modal({
|
|
dismissible: false
|
|
});
|
|
|
|
// Initialize Firebase
|
|
var config = {
|
|
apiKey: "AIzaSyCuvwf78cmSDoZ2yS4XxHZhnjUn7yIHYfw",
|
|
authDomain: "test-667ca.firebaseapp.com",
|
|
databaseURL: "https://test-667ca.firebaseio.com",
|
|
projectId: "test-667ca",
|
|
storageBucket: "test-667ca.appspot.com",
|
|
messagingSenderId: "221332577314"
|
|
};
|
|
|
|
firebase.initializeApp(config);
|
|
|
|
var app = new Vue({
|
|
el: "myapp",
|
|
data: {
|
|
myshoppinglists: [],
|
|
sharedshoppinglists: []
|
|
},
|
|
|
|
methods: {
|
|
fetchData: function() {
|
|
firebase.auth().onAuthStateChanged(function (user) {
|
|
if (user) {
|
|
firebase.auth().currentUser.getIdToken( /* forceRefresh */ true).then(function (idtoken) {
|
|
alert("LALALALAL");
|
|
}).catch((error) => console.error("Get id token client error: ", error));
|
|
} else {
|
|
console.log("Check Auth error", user)
|
|
}
|
|
});
|
|
}
|
|
},
|
|
|
|
mounted() {
|
|
this.fetchData();
|
|
}
|
|
});
|
|
|
|
}); |