Search code examples
javascriptparse-platformparse-server

Parse-server before delete on Session or Logout


I'm trying to write a hook for when a user logs out.

I tried Parse.Cloud.beforeDelete('Session', ...)

That doesn't work. I tried BeforeDeleteRequest on Session and that won't even build, apparently BeforeDeleteRequest is not a function.

Is there anyway to grab the user object upon logout?

Thanks!


Solution

  • I found the following in the source code of Parse.Cloud:

    var restrictedClassNames = ['_Session'];
    if (restrictedClassNames.indexOf(className) != -1) {
        throw 'Triggers are not supported for ' + className + ' class.';
    }
    

    It looks like hooks on Session are not allowed.