T
TanStack2y ago
narrow-beige

How to remove dehydratedState from html?

I generate my pages with getStaticProps with NextJs. In <script id="NEXT_DATA" type="application/json">{"props":{"pageProps":{"dehydratedState"... i have my product_ids, which i dont want to be shown. How can i hide or encrypt this?
No description
2 Replies
narrow-beige
narrow-beigeOP2y ago
The thing is, that i need these Ids for adminRoles, so they can manipulate products on right on client pages. But i dont want anyone to see them, is this possible?
harsh-harlequin
harsh-harlequin2y ago
No it's not possible to do that. Any data you send to the client is effectively public data You'll have to do auth/ role checking on the server

Did you find this page helpful?