Make google auth optional on server side (#508)

* Make google auth optional on server side

* fix lint

* Fix according to review
This commit is contained in:
Charles Bochet
2023-07-04 23:53:53 +02:00
committed by GitHub
parent 6fc416da76
commit 2afe933055
10 changed files with 86 additions and 39 deletions

View File

@ -2,4 +2,5 @@ import { S3ClientConfig } from '@aws-sdk/client-s3';
export interface S3StorageModuleOptions extends S3ClientConfig {
bucketName: string;
region: string;
}

View File

@ -23,9 +23,13 @@ export class S3StorageService {
@Inject(MODULE_OPTIONS_TOKEN)
private readonly options: S3StorageModuleOptions,
) {
const { bucketName, ...s3Options } = options;
const { bucketName, region, ...s3Options } = options;
this.s3Client = new S3(s3Options);
if (!bucketName || !region) {
return;
}
this.s3Client = new S3({ ...s3Options, region });
this.bucketName = bucketName;
}