Apollo with nextjs app router for protected route
Unanswered
American Kestrel posted this in #help-forum
American KestrelOP
Hello, how I can set a protected route with app router and apollo client ? I don't find a doc with examples.
On page router I created a HOC for the protected page. Did you have an idea ?
Thanks
On page router I created a HOC for the protected page. Did you have an idea ?
Thanks
4 Replies
@American Kestrel Hello, how I can set a protected route with app router and apollo client ? I don't find a doc with examples.
On page router I created a HOC for the protected page. Did you have an idea ?
Thanks
you can protect your routes by checking the authorization header or any kind of header/cookie that signifies the user is currently logged on request time.
Im not sure how you integrate it with apollo client but thats how you do it with next-auth
are you trying to protect route.ts or page.tsx?
American KestrelOP
Thanks, I protect page with HOC and it's working fine