mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
use base64 encoded private key for apns
This commit is contained in:
@@ -52,9 +52,10 @@ export class NotificationService {
|
||||
|
||||
const keyId = process.env.APNS_KEY_ID;
|
||||
const teamId = process.env.APNS_TEAM_ID;
|
||||
const privateKeyPath = process.env.APNS_KEY_PATH;
|
||||
if (!privateKeyPath) return;
|
||||
const privateKey = fs.readFileSync(privateKeyPath);
|
||||
|
||||
const privateKeyBase64 = process.env.APNS_PRIVATE_KEY;
|
||||
if (!privateKeyBase64) return;
|
||||
const privateKey = Buffer.from(privateKeyBase64, 'base64').toString('utf-8');
|
||||
|
||||
const tokenHeader = {
|
||||
alg: "ES256",
|
||||
|
||||
Reference in New Issue
Block a user