From 534f86d9de3590d547d05b986095ee64680939c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Born=C3=B6?= Date: Mon, 17 Jan 2022 21:49:49 +0100 Subject: [PATCH] Fix ReferenceError in example --- docs/authentication.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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',