export const getServerSideProps = withIronSessionSsr(
    async function getServerSideProps({ req }): Promise<any> {
        const user = req.session.user
        if (!userreturn {
            redirect: {
                destination: '/login',
                permanent: false
            },
            props: {}
        }

대충 이런 코드인데 작동을 안한다
console.log(user)로 확인해도 undefined가 나옴 


const { idpassword } = req.body
const isEmail = id.includes('@')
const user = await prisma.account.findUnique({ where: isEmail ? { email: id } : { id } })
if (!userreturn res.status(404).json({ error: 'Account not found' })
const isPasswordCorrect = await bcrypt.compare(passworduser.password)
if (!isPasswordCorrectreturn res.status(401).json({ error: 'Password is incorrect' })
req.session.user = {...userpassword: undefined}
await req.session.save()
res.status(200).json({ success: true })

세션 저장하는 코드는 이거임

내컴에선 잘 되는데 서버에서 돌리면 세션이 undefined로 나오는데 왜그러는지 아는 게이있으면 도와줘라