hello Sir . Sir i need to use re authentication for each time when we try to login through facebook login in my ionic2 app.
My all facebook code is
public doFbLogin(){
let permissions = new Array();
let nav = this.navCtrl;
permissions = ["public_profile,email"];
let env = this;
let xyz = "";
Facebook.login(permissions)
.then(function(response){
let userId = response.authResponse.userID;
let params = new Array();
// params.push("{ auth_type: 'reauthenticate' }");
Facebook.api("/me?fields=name,gender,email",params)
.then(function(user) {
user.picture = "https://graph.facebook.com/" + userId + "/picture?type=large";
LoginPage.xyz= user;
console.log("Login",user);
console.log("Ist",LoginPage.xyz);
console.log("2st",user);
NativeStorage.setItem('user',
{
name: user.name,
gender: user.gender,
picture: user.picture
})
.then(function(){
console.log("then");
env.afterFacebookLogin(LoginPage.xyz.id,LoginPage.xyz.email);
}, function (error) {
env.presentLogInToast("Facebook login error");
console.log(error);
})
},
)
},
function(error){
}
);
// ,{ auth_type: ‘reauthenticate’, auth_nonce: ‘{random-nonce}’}
}
dataFunction(){
}
please tell me how to do this because on second time when we try to log in facebook i think gets user data from cache or some where else and used that without asking user for login again. What i need is that on second time or every time when user clicks the facebook button it gets data from facebook api not from cache …
…If you can help me in removing the facebook cache then that would be the best thing too ,.,… Thanks