Redirects not working from NextJS getServerSideProps
See original GitHub issueI followed the way the documentation describes how redirects from drupal can be received from translatePathFromContext. Unfortunatelly the redirects are always empty, even when there are redirects in drupal from same path i am visiting…
is there some setting i miss, maybe persmissions or something else?
this is the code
const path = await drupalClient.translatePathFromContext(context, {
withAuth: true
});
console.log(path?.redirect);
The log is always “undefined”.
Does it makes a difference if “getServerSideProps” or “getStaticProps” is used for next-drupal? Is there a difference in the context object?
I was also wondering, in some cases the original path “/node/3” is working, in other cases only path-aliases are working, without any original paths. And when they are working, also no redirect is happening to the path-alias, only display of content.
Maybe any insight knowledge would be helpful, to figure out what is going on with redirects and if there also special permissions needed.
My Next-JS Consumer also have no admin-rights, because giving him admin-rights would mean we would need no seperate role for the nextjs user, so i try to omit that. Could this be the source of the problem? but then, which permission is missed from here?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6
Top GitHub Comments
@devtim123 Let me see if I can reproduce this. I’ll get back to you.
EDIT: I’m deleting this whole comment.
My issue currently is with the decoupled router module, not with this package. When the decoupled router correctly resolves a redirect, next-drupal is redirecting correctly.