mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-08 08:34:20 +02:00
🔒️ fixing issue with service accout key in secrets
This commit is contained in:
parent
21fef73d08
commit
35c3f8e4f8
@ -355,11 +355,12 @@ export class Sheet<
|
|||||||
return tryNTimes(
|
return tryNTimes(
|
||||||
async () => {
|
async () => {
|
||||||
if (hasGSheetsAccess()) {
|
if (hasGSheetsAccess()) {
|
||||||
|
const key = process.env.GCP_SERVICE_ACCOUNT_PRIVATE_KEY || ""
|
||||||
// Authentication
|
// Authentication
|
||||||
const doc = new GoogleSpreadsheet(process.env.GSHEET_ID)
|
const doc = new GoogleSpreadsheet(process.env.GSHEET_ID)
|
||||||
await doc.useServiceAccountAuth({
|
await doc.useServiceAccountAuth({
|
||||||
client_email: process.env.GCP_SERVICE_ACCOUNT_CLIENT_EMAIL || "",
|
client_email: process.env.GCP_SERVICE_ACCOUNT_CLIENT_EMAIL || "",
|
||||||
private_key: process.env.GCP_SERVICE_ACCOUNT_PRIVATE_KEY || "",
|
private_key: key.replace(/\\n/g, "\n"),
|
||||||
})
|
})
|
||||||
await doc.loadInfo()
|
await doc.loadInfo()
|
||||||
return doc.sheetsByTitle[this.sheetName]
|
return doc.sheetsByTitle[this.sheetName]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user