title: NextJS with next-auth ,setting cookie received from node.js
body: <p>I am using Nextjs with next-auth for authentication with node.js at the backend . Now , I am setting my cookies in node.js and it works correctly in postman. I can authenticate ,without any issue. When it comes to NextJs , since I am only returning the <code>res.data</code> from the response , which essentially contains the user data and not JWT , I am not able to pass the cookies to the frontend. Hence, I am not authenticated for Node.js .I checked the documentation for cookies on next-auth but couldn't make it work .</p>
  <p>The code for <code>./api/[...nextauth.ts]</code></p>
  <pre><code>import axios from 'axios'
  import NextAuth from 'next-auth'
  import Providers from 'next-auth/providers'
  
  export default NextAuth({
    // Configure one or more authentication providers
    providers: [
      Providers.Credentials({
        name: 'Credentials',
        credentials: {
          email: { label: &quot;Email&quot;, type: &quot;email&quot;, placeholder: &quot;Your email&quot; },
          password: { label: &quot;Password&quot;, type: &quot;password&quot;,placeholder: &quot;*********&quot; }
        },
        async authorize(credentials:any, req) {
            try
            {
                const res = await axios.post('http://node-app:4200/users/login',credentials)
                if(res.status==200)
                {
                  return res.data
                }
            }
          catch(e:any){
            console.log(e.data)
          }
          return null
        }
      })
    ],
    pages: {
      signIn: '/auth/login',
      signOut: '/auth/logout',
      // error: '/auth/error', // Error code passed in query string as ?error=
      // verifyRequest: '/auth/verify-request', // (used for check email message)
      // newUser: undefined // If set, new users will be directed here on first sign in
    }
  })
  </code></pre>
  <p>It would be helpful if someone could guide me how to add the cookies that I pushed from node.js to the nextjs's server side can be pushed to the next's frontend.</p>