Escaping issue with firebase privateKey as a Heroku config variable

后端 未结 3 1589
南笙
南笙 2020-12-13 14:03

I\'m trying to create an Heroku node task that reads data from Firebase and console.log it.

My node script (located inside the /bin directory) is:

re         


        
3条回答
  •  隐瞒了意图╮
    2020-12-13 14:21

    I solved this by using the .replace(/\n/g, '\n') on the private key and also removing the quotes from the private key value on heroku config vars like it is bellow.

    -----BEGIN PRIVATE KEY-----\nMY-PRIVATE-KEY\n-----END PRIVATE KEY-----\n

提交回复
热议问题