I have a question about Link component from ‘next-Link ’
What should I do if I want pass a sensitive data like a category_id for example, how can I pass it securely to be used in getServerSideProps() function
I don’t want want to use query string.
>Solution :
If you want to hide data from URL you can use the as property of Next Link :
<Link
href={{
pathname: "/myUrl",
query: { id: "1111" },
}}
as="/myUrl"
>
Go to Page
</Link>;
the url will be : http://localhost:3000/myUrl
but you still can access data :
import { useRouter } from "next/router";
//..
const router = useRouter();
console.log(router.query.id);