add console.log to debug login issues
This commit is contained in:
parent
103009e43f
commit
215247f627
|
@ -5,6 +5,14 @@ const isProduction = process.env.NODE_ENV === "production";
|
||||||
export default function authServerSideProps(getServerSideProps) {
|
export default function authServerSideProps(getServerSideProps) {
|
||||||
return function authenticate(context) {
|
return function authenticate(context) {
|
||||||
if (isProduction && (!("ory_kratos_session" in context.req.cookies) || !("skynet-jwt" in context.req.cookies))) {
|
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 {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
permanent: false,
|
permanent: false,
|
||||||
|
|
Reference in New Issue