Skip to content

Commit

Permalink
fix: profile page of other users returns 404 in the case of logged ou…
Browse files Browse the repository at this point in the history
…t users
  • Loading branch information
rishabhkunwar11 committed Jan 14, 2022
1 parent c0376d7 commit ce3b9cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pages/u/[username].js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ export async function getServerSideProps(context) {
};
}
} else {
const data = await UserService.getUserByUsername(context.params.username);
return {
redirect: {
permanent: false,
destination: "/404"
}
props : {
userData : data?.data
}
};
}
} catch (err) {
Expand Down

0 comments on commit ce3b9cf

Please sign in to comment.