Parse-server: Get request headers within Parse.Cloud.onLiveQueryEvent

Created on 8 Jul 2020  路  2Comments  路  Source: parse-community/parse-server

I am trying to create a custom authorization within the header when accessing the LiveQueryServer, especially when connecting.

Within webhooks I can get the request headers like that

Parse.Cloud.beforeSave("Chat", function(request) {
    console.log( "header: ", request.headers );
});

To use custom headers, I added the header name to a constant named DEFAULT_ALLOWED_HEADERSwithin middleware.js and wrote on the client side this code: Parse.CoreManager.set('REQUEST_HEADERS', {"custom_token": "1234"});

It would be helpful if there would be a same way to access the request header within the Parse.Cloud.onLiveQueryEvent handler.
The current parameter are event, sessionToken, clients, client, subscriptions, error and I've already tried to change it manually within triggers.js and Parse.Cloud.js.

Edit: I've seen this issue, thats exactly what I need, but it seems like it wasnt commited - any clues why?

question

Most helpful comment

Hey @maxiqsoft, we've merged the triggers with the master branch. Hope it helps out your project!

All 2 comments

@maxiqsoft I am still working on cleaning up a few issues in my PR before resubmitting. Been busy. Sorry.

Hey @maxiqsoft, we've merged the triggers with the master branch. Hope it helps out your project!

Was this page helpful?
0 / 5 - 0 ratings