diff --git a/docs/authentication.md b/docs/authentication.md index 45dc5bbe185a4..9163ae9e178ac 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -71,7 +71,9 @@ import withSession from '../lib/session' import Layout from '../components/Layout' export const getServerSideProps = withSession(async function ({ req, res }) { - if (!req.session.user) { + const { user } = req.session + + if (!user) { return { redirect: { destination: '/login',