Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get request headers within Parse.Cloud.onLiveQueryEvent #6779

Closed
maxiqsoft opened this issue Jul 8, 2020 · 2 comments
Closed

Get request headers within Parse.Cloud.onLiveQueryEvent #6779

maxiqsoft opened this issue Jul 8, 2020 · 2 comments
Labels
type:question Support or code-level question

Comments

@maxiqsoft
Copy link

maxiqsoft commented Jul 8, 2020

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_HEADERS within 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?

@mtrezza mtrezza added the type:question Support or code-level question label Jul 8, 2020
@dblythy
Copy link
Member

dblythy commented Jul 12, 2020

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

@dblythy
Copy link
Member

dblythy commented Jul 17, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants