diff --git a/src/commands/config.command.ts b/src/commands/config.command.ts index acaf0c0b..a053288f 100644 --- a/src/commands/config.command.ts +++ b/src/commands/config.command.ts @@ -86,7 +86,7 @@ export class ConfigCommand { private async setGSuiteKey(key: string) { await this.loadConfig(); - this.gsuite.privateKey = key; + this.gsuite.privateKey = key != null ? key.trimLeft() : null; await this.saveConfig(); } diff --git a/src/services/gsuite-directory.service.ts b/src/services/gsuite-directory.service.ts index c26fd0d2..23fa89ad 100644 --- a/src/services/gsuite-directory.service.ts +++ b/src/services/gsuite-directory.service.ts @@ -224,7 +224,7 @@ export class GSuiteDirectoryService extends BaseDirectoryService implements Dire this.client = new google.auth.JWT({ email: this.dirConfig.clientEmail, - key: this.dirConfig.privateKey, + key: this.dirConfig.privateKey != null ? this.dirConfig.privateKey.trimLeft() : null, subject: this.dirConfig.adminUser, scopes: [ 'https://www.googleapis.com/auth/admin.directory.user.readonly',