Skip to content

Commit

Permalink
Update Data Fetching Method (vercel#14190)
Browse files Browse the repository at this point in the history
  • Loading branch information
khattakdev authored and rokinsky committed Jul 11, 2020
1 parent 49f9c02 commit 8e73b4f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/with-cookie-auth-fauna/pages/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Profile = (props) => {
)
}

Profile.getInitialProps = async (ctx) => {
export async function getServerSideProps(ctx) {
if (typeof window === 'undefined') {
const { req, res } = ctx
const cookies = cookie.parse(req.headers.cookie ?? '')
Expand Down
4 changes: 2 additions & 2 deletions examples/with-cookie-auth-fauna/utils/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export const withAuthSync = (Component) => {
return <Component {...props} />
}

if (Component.getInitialProps) {
Wrapper.getInitialProps = Component.getInitialProps
if (Component.getServerSideProps) {
Wrapper.getServerSideProps = Component.getServerSideProps
}

return Wrapper
Expand Down

0 comments on commit 8e73b4f

Please sign in to comment.