From c285f637c2c19918c69123afd4392f6053ff62b8 Mon Sep 17 00:00:00 2001 From: Tmadkaud Date: Fri, 13 Oct 2017 12:25:20 +0200 Subject: [PATCH] rules pour deployer lapp et rectification du bug des email envoyer carte 13 10 2017 --- firebase.json | 13 +++++++++++++ .../envoyer-carte/envoyer-carte.component.ts | 12 ++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/firebase.json b/firebase.json index 0505536..20e5874 100644 --- a/firebase.json +++ b/firebase.json @@ -17,6 +17,19 @@ "key" : "Access-Control-Allow-Origin", "value" : "*" } ] + }, + { + "source" : "**/*.@(jpg|jpeg|gif|png)", + "headers" : [ { + "key" : "Cache-Control", + "value" : "max-age=7200" + } ] + }, { + "source" : "404.html", + "headers" : [ { + "key" : "Cache-Control", + "value" : "max-age=300" + } ] } ], "public": "dist", diff --git a/src/app/components/opCommercial/envoyer-carte/envoyer-carte.component.ts b/src/app/components/opCommercial/envoyer-carte/envoyer-carte.component.ts index 5e15672..8a37934 100644 --- a/src/app/components/opCommercial/envoyer-carte/envoyer-carte.component.ts +++ b/src/app/components/opCommercial/envoyer-carte/envoyer-carte.component.ts @@ -91,7 +91,11 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy { const config = {apiKey: 'AIzaSyD2O5MxwZ4BRWvVc77FZliBvtj0pmcdzos', authDomain: 'webappparrain.firebaseapp.com', - databaseURL: 'https://webappparrain.firebaseio.com'}; + databaseURL: 'https://webappparrain.firebaseio.com', + projectId: 'webappparrain', + storageBucket: 'webappparrain.appspot.com', + messagingSenderId: '808271162007' + }; this.secondaryApp = null; this.secondaryApp = firebase.apps.length <= 1 ? firebase.initializeApp(config, 'Secondary') : firebase.app('Secondary'); @@ -269,16 +273,16 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy { parNewlistTemp.forEach(par => { par.forEach(elementParTemp => { - if (elementParTemp !== undefined) { + if (elementParTemp !== undefined && elementParTemp.email === parrainTemp.email) { if (elementParTemp.uid !== '') { this.getIdParrain(elementParTemp.uid); this.creerCartePar(); this.carteEnvoieEncours = true; this.carteEnvoieOK = true; this.echecRegisterPar = false; + this.secondaryApp.auth().sendPasswordResetEmail(elementParTemp.email); + this.secondaryApp.auth().currentUser.sendEmailVerification(); setTimeout(() => { - this.secondaryApp.auth().sendPasswordResetEmail(elementParTemp.email); - this.secondaryApp.auth().currentUser.sendEmailVerification(); this.secondaryApp.auth().signOut(); this.carteEnvoieEncours = false; this.goToOpComm();