|
|
|
@ -204,25 +204,33 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
|
|
|
|
|
emailVerified: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.parrain.uid = userCreate.uid;
|
|
|
|
|
this.parrain.emailVerified = userCreate.emailVerified;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
this.parrain.uid = userCreate.uid;
|
|
|
|
|
this.parrain.emailVerified = userCreate.emailVerified;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userRef.set(this.parrain);
|
|
|
|
|
console.log('crer par: '+ this.parrain.firstname);
|
|
|
|
|
// this.cartePar.parrainCarte = this.parrain;
|
|
|
|
|
this.getIdParrain(userCreate.uid);
|
|
|
|
|
console.log('creer par userCreate.uid: '+ userCreate.uid);
|
|
|
|
|
this.creerCartePar();
|
|
|
|
|
console.log('creer par creerCartePar: '+ this.cartePar.uid);
|
|
|
|
|
firebase.auth().sendPasswordResetEmail(this.parrain.email);
|
|
|
|
|
userCreate.sendEmailVerification();
|
|
|
|
|
console.log('avant logout firebase.auth().currentUser.uid: '+ firebase.auth().currentUser.uid);
|
|
|
|
|
firebase.auth().signOut();
|
|
|
|
|
firebase.auth().signInWithEmailAndPassword(this.commercant.email, this.commercant.password);
|
|
|
|
|
console.log('avant logout firebase.auth().currentUser.uid: '+ firebase.auth().currentUser.uid);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// No content response..
|
|
|
|
|
console.log('error dans envoyer carte !')
|
|
|
|
|
console.log(e);
|
|
|
|
|
// this.router.navigate(['/']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userRef.set(this.parrain);
|
|
|
|
|
console.log('crer par: '+ this.parrain.firstname);
|
|
|
|
|
// this.cartePar.parrainCarte = this.parrain;
|
|
|
|
|
this.getIdParrain(userCreate.uid);
|
|
|
|
|
console.log('creer par userCreate.uid: '+ userCreate.uid);
|
|
|
|
|
this.creerCartePar();
|
|
|
|
|
console.log('creer par creerCartePar: '+ this.cartePar.uid);
|
|
|
|
|
firebase.auth().sendPasswordResetEmail(this.parrain.email);
|
|
|
|
|
userCreate.sendEmailVerification();
|
|
|
|
|
console.log('avant logout firebase.auth().currentUser.uid: '+ firebase.auth().currentUser.uid);
|
|
|
|
|
firebase.auth().signOut();
|
|
|
|
|
firebase.auth().signInWithEmailAndPassword(this.commercant.email, this.commercant.password);
|
|
|
|
|
console.log('avant logout firebase.auth().currentUser.uid: '+ firebase.auth().currentUser.uid);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|