Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- login(){
- this.af.auth.login({
- email: this.email,
- password: this.password
- },{
- provider: AuthProviders.Password,
- method: AuthMethods.Password
- }).then((response)=>{
- // console.log('Login geslaagd' + JSON.stringify(response));
- // console.log(this.email);
- // console.log(this.password);
- let currentuser = {
- email: response.auth.email,
- picture: response.auth.photoURL,
- userUID: response.auth.uid
- };
- //console.log("current user mail "+ currentuser.userUID);
- window.localStorage.setItem('currentuserEmail',JSON.stringify(currentuser.userUID));
- window.localStorage.setItem('currentuser', JSON.stringify(currentuser))
- this.navCtrl.setRoot(HomePage);
- //this.navCtrl.push(HomePage);
- })//.then((response) => {
- //this.navCtrl.push(HomePage);
- //}
- .catch((error)=> {
- this.tonenErrorPopUp(error);
- console.log(error);})
- }
- tonenErrorPopUp(error){
- setTimeout(() => {});
- let prompt = this.alertCtrl.create({
- title: 'Fail',
- subTitle: error,
- buttons: ['ok']
- });
- prompt.present();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement