I am using ionic 3 and firebase authentication using facebook. The facebook does not return email id if user did not provided one while signup or did not verify it at all.
Our system mandates providing of email id. So, as a fall back we prompt user to provide the email id. As we let user manually provide the email id at this step so there is a need to verify it.
It seems firebase auth sendEmailVerifcation required the email id already in the auth. As our case is specifically handling when this is missing so how can we use this feature to validate the email id?
Any other ideas are welcome too to handle it. It is a critical blocker for us as people are misusing our reward system by providing fake email ids.
I have looked into the sendEmailVerification api but it does not seem to accept any parameter to manually pass the email id.
constructor(public navCtrl: NavController,
public navParams: NavParams,
private afAuth: AngularFireAuth,
private fb: Facebook,
private platform: Platform,
private core:CoreProvider,
public viewCtrl: ViewController,
private ddlSvc: DoodleDataProvider,
private alertCtrl:AlertController,
private toastCtrl: ToastController) {
//block back button on android
platform.registerBackButtonAction(() => {
},1);
afAuth.authState.subscribe(user => {
console.log("auth subscription finished: with user:" + JSON.stringify(user))
//go back if user could not be retrieved or manual logout is set to true
if (!user || core.manualLogout == true) {
return;
}
user.sendEmailVerfication() //problem here when email is null
console.log("initializing user")
this.createUser(user.uid)
});
}
sendEmailVerficationto send the verification message.