User bearbeiten fix
Noch ein fix
This commit is contained in:
		@@ -9,7 +9,6 @@ var config = {
 | 
			
		||||
};
 | 
			
		||||
firebase.initializeApp(config);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async function checkAuth() {
 | 
			
		||||
  await firebase.auth().onAuthStateChanged(async function (user) {
 | 
			
		||||
    if (user) {
 | 
			
		||||
@@ -25,9 +24,7 @@ async function checkAuth() {
 | 
			
		||||
}
 | 
			
		||||
window.onload = function () {
 | 
			
		||||
  checkAuth();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
var vue = new Vue({
 | 
			
		||||
  el: '#vue-app',
 | 
			
		||||
@@ -54,7 +51,6 @@ var vue = new Vue({
 | 
			
		||||
        var idToken = result.credential.idToken;
 | 
			
		||||
        // The signed-in user info.
 | 
			
		||||
        var user = result.user;
 | 
			
		||||
        console.log("Eingelogt");
 | 
			
		||||
        checkAuth();
 | 
			
		||||
      }).catch(function (error) {
 | 
			
		||||
        // Handle Errors here.
 | 
			
		||||
@@ -71,37 +67,9 @@ var vue = new Vue({
 | 
			
		||||
      firebase.auth().signInWithEmailAndPassword(this.email, this.password).then(result => {
 | 
			
		||||
        checkAuth();
 | 
			
		||||
      }).catch(function (error) {
 | 
			
		||||
        // Handle Errors here.
 | 
			
		||||
        var errorCode = error.code;
 | 
			
		||||
        var errorMessage = error.message;
 | 
			
		||||
        // ...
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  mounted() {
 | 
			
		||||
    /*axios.post('/user', {
 | 
			
		||||
        message_id: 'test',
 | 
			
		||||
      })
 | 
			
		||||
      .then(function (response) {
 | 
			
		||||
        console.log(response);
 | 
			
		||||
      })
 | 
			
		||||
      .catch(function (error) {
 | 
			
		||||
        console.log(error);
 | 
			
		||||
      });*/
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // mounted() {
 | 
			
		||||
  //     axios.post('/user', {
 | 
			
		||||
  //         message_id: 'test',
 | 
			
		||||
  //       })
 | 
			
		||||
  //       .then(function (response) {
 | 
			
		||||
  //         console.log(response);
 | 
			
		||||
  //       })
 | 
			
		||||
  //       .catch(function (error) {
 | 
			
		||||
  //         console.log(error);
 | 
			
		||||
  //       });
 | 
			
		||||
  // }
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
@@ -27,8 +27,8 @@ var vue = new Vue({
 | 
			
		||||
        image: '',
 | 
			
		||||
        idToken: '',
 | 
			
		||||
        mid: '',
 | 
			
		||||
        showUploadButtons: ''
 | 
			
		||||
 | 
			
		||||
        showUploadButtons: '',
 | 
			
		||||
        uploadfinish: false
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        backToDash(){
 | 
			
		||||
@@ -49,7 +49,7 @@ var vue = new Vue({
 | 
			
		||||
                            vm.idToken = idToken;
 | 
			
		||||
                            vm.mid = token;
 | 
			
		||||
                            vm.dbUserUpdate(vm.idToken, vm.name, vm.image, vm.mid);
 | 
			
		||||
                            window.location.href = "/";
 | 
			
		||||
                            //window.location.href = "/";
 | 
			
		||||
                        })
 | 
			
		||||
                        .catch(err => {
 | 
			
		||||
                            console.error("Msg Error: ", err);
 | 
			
		||||
@@ -57,7 +57,7 @@ var vue = new Vue({
 | 
			
		||||
                            vm.mid = "";
 | 
			
		||||
                            vm.dbUserUpdate(vm.idToken, vm.name, vm.image, vm.mid);
 | 
			
		||||
 | 
			
		||||
                            window.location.href = "/";
 | 
			
		||||
                            //window.location.href = "/";
 | 
			
		||||
                        })
 | 
			
		||||
                    
 | 
			
		||||
                }).catch(function (error) {
 | 
			
		||||
@@ -65,7 +65,7 @@ var vue = new Vue({
 | 
			
		||||
                });
 | 
			
		||||
            }else{
 | 
			
		||||
                this.dbUserUpdate(this.idToken, this.name, this.image, this.mid);
 | 
			
		||||
                window.location.href = "/"; 
 | 
			
		||||
                //window.location.href = "/"; 
 | 
			
		||||
            }
 | 
			
		||||
            
 | 
			
		||||
        },
 | 
			
		||||
@@ -101,7 +101,6 @@ var vue = new Vue({
 | 
			
		||||
                displayName: name,
 | 
			
		||||
                photoURL: pic
 | 
			
		||||
            }).then(async function () {
 | 
			
		||||
 | 
			
		||||
            }).catch(function (error) {
 | 
			
		||||
                console.error(error)
 | 
			
		||||
            });
 | 
			
		||||
@@ -117,6 +116,7 @@ var vue = new Vue({
 | 
			
		||||
                    name: name
 | 
			
		||||
                },
 | 
			
		||||
                success(result) {
 | 
			
		||||
                    vm.uploadfinish = true;
 | 
			
		||||
                    //vm.startGetUser();
 | 
			
		||||
                },
 | 
			
		||||
                error(err) {
 | 
			
		||||
@@ -169,6 +169,7 @@ var vue = new Vue({
 | 
			
		||||
            }).catch(err => console.error(err));
 | 
			
		||||
        },
 | 
			
		||||
        onFileChange(e) {
 | 
			
		||||
            this.uploadfinish = false;
 | 
			
		||||
            var files = e.target.files || e.dataTransfer.files;
 | 
			
		||||
            if (!files.length)
 | 
			
		||||
                return;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user