How do I prevent a static page from unauthorized ones? #16119
Unanswered
rozenonline
asked this question in
Help
Replies: 1 comment
-
What I've done for this is to use normal static page for the public posts and to use CSR (client-side rendering) for private posts since SEO is not relevant for privates.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a simple blog that has public posts and private posts.
The page for post view is using getStaticProps to populate post data
Now I want to prevent unauthorized ones to access the private posts.
I have researched about it but seems like it's impossible to implement so.
I've tried to redirect in the component as follows
It redirects in a flash but it still reveals the private post.
Also is revealed clearly in the view-source page.
I've been struggling on this for whole 2 days.
Is it really impossible?
Beta Was this translation helpful? Give feedback.
All reactions