Skip to content

Commit

Permalink
Fix: Change error log
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilalekha committed Jun 22, 2021
1 parent 9dac98d commit e697d7e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pages/posts/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,15 @@ export async function getServerSideProps(context) {
try {
console.log(context.query);
const post_Id = context.query.post_id;
let cookie = "";
if (context.req.headers.cookie) {
cookie = JSON.parse(
const cookie = JSON.parse(
getCookieValue(context.req.headers.cookie, "userNullcast")
);
// console.log(cookie);
return { props: { post_Id: post_Id ? post_Id : "" } };
} else {
return {
redirect: {
permanent: false,
destination: "/login"
}
};
}
} catch (err) {
console.log("Error =============== > ", err);
console.log("User not logged in ");
return {
redirect: {
permanent: false,
Expand Down

0 comments on commit e697d7e

Please sign in to comment.