import { Global, Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { UserProvider } from './domain/providers/user';
import { SessionService } from './domain/services/session.service';
import { JWT_EXPIRED, JWT_SECRET } from './constants';

@Global()
@Module({
  imports: [
    JwtModule.register({
      secret: JWT_SECRET,
      signOptions: { expiresIn: JWT_EXPIRED },
    }),
  ],
  providers: [SessionService, UserProvider],
  exports: [SessionService, UserProvider],
})
export class SessionModule {}
