mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Fix issue with key based credentials not being read correctly (#6824)
This commit is contained in:
@@ -11,6 +11,8 @@ import type { OptionsWithUri } from 'request';
|
||||
import moment from 'moment-timezone';
|
||||
import * as jwt from 'jsonwebtoken';
|
||||
|
||||
import { formatPrivateKey } from '@utils/utilities';
|
||||
|
||||
const googleServiceAccountScopes = {
|
||||
bigquery: ['https://www.googleapis.com/auth/bigquery'],
|
||||
books: ['https://www.googleapis.com/auth/books'],
|
||||
@@ -69,7 +71,7 @@ export async function getGoogleAccessToken(
|
||||
|
||||
const scopes = googleServiceAccountScopes[service];
|
||||
|
||||
const privateKey = (credentials.privateKey as string).replace(/\\n/g, '\n').trim();
|
||||
const privateKey = formatPrivateKey(credentials.privateKey as string);
|
||||
credentials.email = ((credentials.email as string) || '').trim();
|
||||
|
||||
const now = moment().unix();
|
||||
|
||||
Reference in New Issue
Block a user