Next.js Discord

Discord Forum

service worker

Transvaal lion posted this in #help-forum
Open in Discord
Original message was deleted.

1 Reply

Transvaal lion
 const csrf = await axios.get('', {withCredentials: false}).catch(e => console.log(e));
        const csrfToken =;

      //  const csrfCookie = csrf.headers['set-cookie'][0].split(';')[0].split('=')[1];

        const login = await'', `json=true&csrfToken=${csrfToken}&email=${email}&password=${password}`, {
            headers: {
                "Content-Type": "application/x-www-form-urlencoded",
                Cookie: `next-auth.csrf-token=${csrfToken}`
        }).catch(e => console.log(e));


        const session = await axios.get('');

I tried using this code, it's indeed a 200 response on login, but I don't have any cookies including the session, only a url containing this
"url": ""