Skip to content

Commit

Permalink
Update Data Fetching Method (#14190)
Browse files Browse the repository at this point in the history
  • Loading branch information
khattakdev committed Jun 16, 2020
1 parent 6ff7200 commit 8cfa518
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
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
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 8cfa518

Please sign in to comment.