diff --git a/src/components/SignUp.jsx b/src/components/SignUp.jsx index 7574670..91c2580 100644 --- a/src/components/SignUp.jsx +++ b/src/components/SignUp.jsx @@ -19,16 +19,12 @@ class SignUp extends Component { } signUp() { - console.log(this.state); const {email, password,name} = this.state; firebaseApp.auth().createUserWithEmailAndPassword(email, password) .then(() => { var user = firebaseApp.auth().currentUser; firebase.database().ref('users/' + user.uid).set({ - username: name, - - - + username: name, }); user.sendEmailVerification().then(function() { console.log("verification email sent") diff --git a/src/index.js b/src/index.js index 85df93a..8e9c9ff 100644 --- a/src/index.js +++ b/src/index.js @@ -16,21 +16,18 @@ const store = createStore(reducer); firebaseApp.auth().onAuthStateChanged(user => { if(user) { - console.log(user.emailVerified); - const { displayName } = user; + console.log(user.emailVerified); + const { displayName } = user; const email = displayName; store.dispatch(logUser(email)); if(user.emailVerified) { - hashHistory.push('/app'); - - } else { - alert('Please check your inbox for a verification e-mail and follow the instructions'); - user.sendEmailVerification().then(function() { - hashHistory.replace('/signin'); - - }); - } - + hashHistory.push('/app'); + } else { + alert('Please check your inbox for a verification e-mail and follow the instructions'); + user.sendEmailVerification().then(function() { + hashHistory.replace('/signin'); + }); + } } else { hashHistory.replace('/signin');