mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-06-08 00:24:21 +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(
|
||||
async () => {
|
||||
if (hasGSheetsAccess()) {
|
||||
const key = process.env.GCP_SERVICE_ACCOUNT_PRIVATE_KEY || ""
|
||||
// Authentication
|
||||
const doc = new GoogleSpreadsheet(process.env.GSHEET_ID)
|
||||
await doc.useServiceAccountAuth({
|
||||
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()
|
||||
return doc.sheetsByTitle[this.sheetName]
|
||||
|
Loading…
x
Reference in New Issue
Block a user