From 215247f62758820bb870cd67ba2d5a4c3339545f Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 29 Sep 2021 12:40:15 +0200 Subject: [PATCH] add console.log to debug login issues --- packages/dashboard/src/services/authServerSideProps.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/dashboard/src/services/authServerSideProps.js b/packages/dashboard/src/services/authServerSideProps.js index bc7bf43c..75583b3d 100644 --- a/packages/dashboard/src/services/authServerSideProps.js +++ b/packages/dashboard/src/services/authServerSideProps.js @@ -5,6 +5,14 @@ const isProduction = process.env.NODE_ENV === "production"; export default function authServerSideProps(getServerSideProps) { return function authenticate(context) { if (isProduction && (!("ory_kratos_session" in context.req.cookies) || !("skynet-jwt" in context.req.cookies))) { + if (!("ory_kratos_session" in context.req.cookies)) { + console.log(`Cookie ory_kratos_session is present but skynet-jwt is not - redirecting to login`); + } + + if (!("skynet-jwt" in context.req.cookies)) { + console.log(`Cookie skynet-jwt is present but ory_kratos_session is not - redirecting to login`); + } + return { redirect: { permanent: false,