How to have Session object deleted in Parse.Cloud on user log out?

74 views
Skip to first unread message

Alexis L.

unread,
Mar 10, 2017, 6:38:51 AM3/10/17
to back{4}app
Hello,

I'm calling webhooks the following way:


app.post('/webhook', function(request, response) {

    //Sanity checks....

Parse.User.logIn("foo", "bar").then(function(result){
return Parse.Cloud.run("mycloudFn");
}).then(function(result){
response.
status(200).send('ok');
},function(error){
response.
status(401).send(error.message);
});
});

The problem is that Login creates a Session object that I can't quite get rid of..... I tried to call request.user.logOut() in the cloud function, but this breaks the code, since the user doesn't exist anymore. Calling user.logOut() in the webhook's success/error closure has detrimental side effects since the response back to the client can't insert the session cookie anymore.

What's the suggestion on b4a side? How can I get the session object to be deleted while calling webhooks?
thanks



cha...@back4app.com

unread,
Jul 10, 2017, 3:51:36 PM7/10/17
to Back4App
Hi!

Were you able to solve your issue?

Regards,

Charles Ramos

Alexis L.

unread,
Jul 11, 2017, 12:44:44 AM7/11/17
to Back4App
yes, thanks
Reply all
Reply to author
Forward
0 new messages