Mit Email und Passwort registrieren
Leitet noch nicht auf / weiter Setzt dem User kein Bild und keinen Namen
This commit is contained in:
		@@ -43,8 +43,8 @@ window.onload = function () {
 | 
			
		||||
var vue = new Vue({
 | 
			
		||||
  el: '#vue-app',
 | 
			
		||||
  data: {
 | 
			
		||||
      email: "",
 | 
			
		||||
      password: ""
 | 
			
		||||
    email: "",
 | 
			
		||||
    password: ""
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    login() {
 | 
			
		||||
@@ -70,10 +70,10 @@ var vue = new Vue({
 | 
			
		||||
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    loginemail(){
 | 
			
		||||
      firebase.auth().signInWithEmailAndPassword(this.email, this.password).then(result =>{
 | 
			
		||||
    loginemail() {
 | 
			
		||||
      firebase.auth().signInWithEmailAndPassword(this.email, this.password).then(result => {
 | 
			
		||||
        checkAuth();
 | 
			
		||||
      }).catch(function(error) {
 | 
			
		||||
      }).catch(function (error) {
 | 
			
		||||
        // Handle Errors here.
 | 
			
		||||
        var errorCode = error.code;
 | 
			
		||||
        var errorMessage = error.message;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										52
									
								
								express-server/public/javascripts/registerEmail.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								express-server/public/javascripts/registerEmail.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,52 @@
 | 
			
		||||
// 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 vue = new Vue({
 | 
			
		||||
    el: '#vue-app',
 | 
			
		||||
    data: {
 | 
			
		||||
        name: "",
 | 
			
		||||
        email: "",
 | 
			
		||||
        picurl: "",
 | 
			
		||||
        password: ""
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
        registerEmail() {
 | 
			
		||||
            var user = firebase.auth().currentUser;
 | 
			
		||||
 | 
			
		||||
            firebase.auth().createUserWithEmailAndPassword(this.email, this.password).catch(function (error) {
 | 
			
		||||
                // Handle Errors here.
 | 
			
		||||
                var errorCode = error.code;
 | 
			
		||||
                var errorMessage = error.message;
 | 
			
		||||
 | 
			
		||||
                console.error(error)
 | 
			
		||||
                // ...
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            user.updateProfile({
 | 
			
		||||
                displayName: this.name,
 | 
			
		||||
                photoURL: this.picurl
 | 
			
		||||
            }).then(function () {
 | 
			
		||||
                // Update successful.
 | 
			
		||||
            }).catch(function (error) {
 | 
			
		||||
                console.error(error)
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            user.updateEmail(this.email).then(function () {
 | 
			
		||||
                // Update successful.
 | 
			
		||||
            }).catch(function (error) {
 | 
			
		||||
                console.error(error)
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            window.location.href = "/";
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
})
 | 
			
		||||
		Reference in New Issue
	
	Block a user