From e7b988c0428df5c41958c6d5a633c9fb24dbb191 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 7 Jun 2019 11:21:55 -0400 Subject: [PATCH] trimLeft on gsuite key --- src/commands/config.command.ts | 2 +- src/services/gsuite-directory.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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',