Reputation: 87
so, I'm a user manager and I want to delete an account which also means I want to invalidate that particular user access token.
I have inbuilt loopback accesstoken table which has token and userId.
Person.find({ where: { id: userId } }).then(user, function(){
user.logout(user.id);
});
when I do this, I get the follwing error Custom inspection function on Objects via .inspect() is deprecated
I'm not sure how to logout other users.
Upvotes: 1
Views: 278
Reputation: 170
Simply delete all the access tokens associated to that user from AccessToken table.
Below is the sample code for your reference :
User.app.models.AccessToken.destroyAll({
userId
}, (err) => {
if (err) return callback(err);
return callback(null,true);
});
Upvotes: 2