Ashan Priyadarshana
1 min readJun 6, 2020

--

First of all, thank you very much, this is very helpfull. But I ran into a problem. It's explained in typescript and I use javascript. So I used getServerSideAuth(context.req) as follows:

export async function getServerSideProps(context) {

// getServerSideAuth will parse the cookie

const initialAuth = getServerSideAuth(context.req);

return { props: { initialAuth } };

}

And then I Try to access it as:

const Home= ({initialAuth}) => {

console.log("props is: " +util.inspect(initialAuth))

....

}

But I get the null for `initialAuth`

--

--

Ashan Priyadarshana
Ashan Priyadarshana

Written by Ashan Priyadarshana

Technical Lead | MSc. Artificial Intelligence | BSc. Information Technology | Founder www.fixmynotes.com, www.vehiclehub.lk | GSoC 2017

Responses (3)