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

Give access to parsed cookies on the req #199

Closed
kentcdodds opened this issue Jun 5, 2020 · 1 comment · Fixed by #261
Closed

Give access to parsed cookies on the req #199

kentcdodds opened this issue Jun 5, 2020 · 1 comment · Fixed by #261
Assignees
Labels
Milestone

Comments

@kentcdodds
Copy link
Contributor

Is your feature request related to a problem? Please describe.

When trying to use msw for an app that uses cookies for things like authentication, I have to manually parse document.cookie.

Describe the solution you'd like

I'd like to be able to access the (parsed) cookies in my requests via req.cookies.

Describe alternatives you've considered

I can parse it myself.

Additional context

I'm thinking about switching https://github.com/kentcdodds/bootstrap to use cookies instead of localStorage jwt tokens for authentication due to security concerns. I'm not 100% certain that I'll do it (because that opens a whole new can of worms), but in any case I think it would be a hard requirement for people who are using cookies for their authentication scheme in their app.

@kettanaito kettanaito added this to the 0.20.0 milestone Jun 27, 2020
@kettanaito kettanaito self-assigned this Jul 2, 2020
@kettanaito
Copy link
Member

Hey, @kentcdodds! Thanks for suggesting this. Finally, I'm going to get to implementing the access to request cookies in a request handler. Should be released in the next version. Stay tuned!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants