I am currently using NestJS
with SessionModule
to handle user cookies successfully. However, I have a requirement to override the domain name for certain requests. I am uncertain about how to achieve this within NestJS
, as the domain setting appears to be inside the imports
array of a module, and there is no apparent way to inject req: Request
directly.
@Module({
imports: [
SessionModule.forRoot({
session: {
secret: 'someSecret',
name: `ssid`,
cookie: {
maxAge: 1234125645654,
domain: '' // I need to set this sometimes during some requests.
},
},
}),
],
export class AppModule implements NestModule, OnModuleInit { }