【发布时间】:2022-01-09 01:48:09
【问题描述】:
我似乎得到了错误:
You should not access 'res' after getServerSideProps resolves.
使用以下代码:
export const getServerSideProps = withPageAuthRequired({
async getServerSideProps(ctx){
// access the user session
const session = getSession(ctx.req,ctx.res);
return {props:{
customProp:'bar'
}};
}
});
我不知道在实现 auth0 时是否有办法摆脱这个警告我在 Next.js 12.0.4 & auth0 ^1.6.1
消除此错误的最佳方法是什么?
【问题讨论】:
-
仅供参考,Auth0 Nextjs SDK 在 github 存储库上有一个问题,在此处跟踪:github.com/auth0/nextjs-auth0/issues/524