add console.log to debug login issues

This commit is contained in:
Karol Wypchlo 2021-09-29 12:42:25 +02:00
parent 215247f627
commit 9fd52abdbe
No known key found for this signature in database
GPG Key ID: C92C016317A964D0
1 changed files with 4 additions and 4 deletions

View File

@ -5,12 +5,12 @@ 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`);
}
if (!("skynet-jwt" in context.req.cookies)) {
console.log(`Cookie skynet-jwt is present but ory_kratos_session is not - redirecting to login`);
if ("ory_kratos_session" in context.req.cookies) {
console.log(`Cookie ory_kratos_session is present but skynet-jwt is not - redirecting to login`);
}
return {