Access request cookies in getStaticProps when preview mode is enabled
Unanswered
Satin posted this in #help-forum
SatinOP
Hi everyone,
I'm trying to implement isr caching in pages router but I want to allow admin to see the page on request time. So when the request comes to getStaticProps i could get admin access token and send it to backend servers. How can i solve this issue? Is there a way to access request cookies in getStaticProps?
My current solution is to store admin access token in redis when calling enable preview api and read it in getStaticProps from redis. However this solution raises some security concerns.
Thanks in advance.
I'm trying to implement isr caching in pages router but I want to allow admin to see the page on request time. So when the request comes to getStaticProps i could get admin access token and send it to backend servers. How can i solve this issue? Is there a way to access request cookies in getStaticProps?
My current solution is to store admin access token in redis when calling enable preview api and read it in getStaticProps from redis. However this solution raises some security concerns.
Thanks in advance.
1 Reply
SatinOP
Can anyone pls help me with this?