0
I am working on nestJS Graphql Project , and the problem is that when i send the cookie it is not setting on client and if i manually put the cookie it cant read also , but the thing that amazing me is when i login on sever by graphql playground it is setting the data and working smoothly and also it is showing that when i check login from client it is logged In
My Codes
main.ts
// setting cookie parser app.use(cookieParser()); // cors origin app.enableCors({ origin:true, credentials:true })
app.module.ts
GraphQLModule.forRoot<ApolloDriverConfig>({ driver: ApolloDriver, autoSchemaFile: join(process.cwd(), 'src/schema.gql'), context: ({ req , res }) => ({ req, res }), playground:{ settings: { 'request.credentials': 'include', }, }, cors: { credentials: true, origin: true } }),```
login.resolver.ts
context.res.cookie('__user', val.token, { httpOnly: true, maxAge: 1000 * 60 * 60 * 24 * 365, sameSite: 'none', secure: true, });```
checkLogin.service.ts
const cookieValue = context.req.cookies['__user']
|