Skip to content

Commit c634d76

Browse files
authored
ReferenceError in authentication.md example fixed (vercel#33411)
Before ```jsx export const getServerSideProps = withSession(async function ({ req, res }) { if (!req.session.user) { return { redirect: { destination: '/login', permanent: false, }, } } return { props: { user }, // User not defined } }) ```
1 parent 41614e5 commit c634d76

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/authentication.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ import withSession from '../lib/session'
7171
import Layout from '../components/Layout'
7272

7373
export const getServerSideProps = withSession(async function ({ req, res }) {
74-
if (!req.session.user) {
74+
const { user } = req.session
75+
76+
if (!user) {
7577
return {
7678
redirect: {
7779
destination: '/login',

0 commit comments

Comments
 (0)