Auth0 Next.js error withPageAuthRequired 您不应在 getServerSideProps 解析后访问 'res'
Auth0 Next.js error withPageAuthRequired You should not access 'res' after getServerSideProps resolves
我似乎遇到了错误:
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
消除此错误的最佳方法是什么?
我似乎遇到了错误:
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
消除此错误的最佳方法是什么?