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:
@ -2,4 +2,5 @@ import { S3ClientConfig } from '@aws-sdk/client-s3';
|
||||
|
||||
export interface S3StorageModuleOptions extends S3ClientConfig {
|
||||
bucketName: string;
|
||||
region: string;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user