Skip to content

Commit

Permalink
Extract COGNITO_REGION env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed Jan 8, 2025
1 parent 19f20d4 commit efb0f11
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/server-asset-sg/src/features/users/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { CognitoIdentityProviderClient, ListUsersCommand } from '@aws-sdk/client
import { Injectable, Logger } from '@nestjs/common';
import { SchedulerRegistry } from '@nestjs/schedule';
import { CronJob } from 'cron';
import { region } from '@/utils/file/common';
import { readEnv } from '@/utils/requireEnv';

@Injectable()
Expand All @@ -13,7 +12,7 @@ export class UserService {
private readonly _poolId: string | null;

constructor(private readonly schedulerRegistry: SchedulerRegistry) {
this.client = new CognitoIdentityProviderClient({ region });
this.client = new CognitoIdentityProviderClient({ region: readEnv('COGNITO_REGION') ?? 'local' });
this._poolId = readEnv('COGNITO_POOL_ID');

if (this._poolId === null) {
Expand Down

0 comments on commit efb0f11

Please sign in to comment.