Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

[GraphiQL] Allow to pass cookies from the client #30

Closed
wants to merge 1 commit into from

Conversation

arunoda
Copy link

@arunoda arunoda commented Oct 27, 2015

This allows to back a auth middleware in-front of the GraphiQL UI.

Some background info:

I wanted to deploy this GraphiQL dashboard to a production app. But, I can't deploy it without even a simple auth system.

So, I implemented a simple basic-auth middleware and add a cookie (with some auth-key) for other requests. (specially from the fetch). But, by default fetch does not forward cookies. We need to add an option to do it.

Here I've only enabled same-origin policy. So, it's cause no harm.

This allows to back a auth middleware in-front of the GraphiQL UI.
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@leebyron
Copy link
Contributor

Master and a deployed release currently have credentials: 'include', but please let me know if this isn't sufficent

@leebyron leebyron closed this Nov 30, 2015
@arunoda
Copy link
Author

arunoda commented Nov 30, 2015

This is great.
Thanks.

brandonbloom added a commit to brandonbloom/graphiql-app that referenced this pull request Oct 12, 2016
Fixes skevy#40.

See this corresponding change in express-graphql: graphql/express-graphql#30
skevy pushed a commit to skevy/graphiql-app that referenced this pull request Oct 15, 2016
Fixes #40.

See this corresponding change in express-graphql: graphql/express-graphql#30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants