Skip to content

Conversation

Grohden
Copy link
Contributor

@Grohden Grohden commented Apr 2, 2025

This is a follow-up for #45794

In this PR I'm documenting how to setup CSP in emotion cache for nextjs page router

Signed-off-by: Gabriel Rohden <[email protected]>
@Grohden Grohden changed the title [nextjs] Document CSP for next [nextjs] Document CSP for nextjs Apr 2, 2025
@aarongarciah aarongarciah added docs Improvements or additions to the documentation. nextjs labels Apr 3, 2025
@aarongarciah aarongarciah changed the title [nextjs] Document CSP for nextjs [docs][nextjs] Document CSP for nextjs Apr 3, 2025
@aarongarciah aarongarciah changed the title [docs][nextjs] Document CSP for nextjs [docs][nextjs] Document CSP for Next.js Apr 3, 2025
@aarongarciah aarongarciah changed the title [docs][nextjs] Document CSP for Next.js [docs][nextjs] Document CSP for Next.js Pages Router Apr 3, 2025
@aarongarciah
Copy link
Member

@Grohden is this ready for review?

@mui-bot
Copy link

mui-bot commented Apr 3, 2025

@Grohden
Copy link
Contributor Author

Grohden commented Apr 5, 2025

@aarongarciah oh, sorry, yes it is!

@Grohden Grohden marked this pull request as ready for review April 5, 2025 02:30
Co-authored-by: Aarón García Hervás <[email protected]>
Signed-off-by: Gabriel Rohden <[email protected]>
Copy link
Contributor

@mapache-salvaje mapache-salvaje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small copy edits here otherwise I think it's good to go 👍

Co-authored-by: Sam Sycamore <[email protected]>
Signed-off-by: Gabriel Rohden <[email protected]>
@Grohden
Copy link
Contributor Author

Grohden commented Apr 7, 2025

@mapache-salvaje thx for the review! I've applied your suggestions 🙏

Copy link
Contributor

@mapache-salvaje mapache-salvaje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Grohden !!

@Janpot
Copy link
Member

Janpot commented Apr 7, 2025

should this also mention how the x-nonce and csp headers get set? (i.e. something about ./middleware.ts)

@Grohden
Copy link
Contributor Author

Grohden commented Apr 8, 2025

@Janpot you guys decide 🫡

the setting up a nonce part
https://github.com/mui/material-ui/pull/45798/files#diff-7e73d61b447905a1fad63d0bdcf0fb5733f7593ca893a8912e675c274dad25afR85

Links to the vercel docs about how to do it, I felt it would be too big for this doc so I didn't mention it, but up to you all

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Links to the vercel docs about how to do it

Right, totally glanced over that. Seems good to me

@mapache-salvaje
Copy link
Contributor

+1 for leaving those details to the Next.js docs so we won't have as much content to keep in sync on our side 😁

@Janpot Janpot merged commit fa8aea0 into mui:master Apr 8, 2025
22 checks passed
@Janpot
Copy link
Member

Janpot commented Apr 8, 2025

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation. nextjs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants