mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 22:10:24 +00:00
feat: using private key from environment
This commit is contained in:
parent
02013bc6be
commit
cfd8d4cc5e
@ -1,8 +1,7 @@
|
|||||||
import * as fs from 'fs'
|
|
||||||
import * as jwt from 'jsonwebtoken'
|
import * as jwt from 'jsonwebtoken'
|
||||||
|
|
||||||
const publicPem = fs.readFileSync('./public.pem')
|
const publicPem = process.env.PUBLIC_PEM
|
||||||
const privateKey = fs.readFileSync('./private.key')
|
const privateKey = process.env.PRIVATE_KEY
|
||||||
|
|
||||||
export function sign(payload: string | Record<string, unknown>, options?: JWTSignOption): string | null {
|
export function sign(payload: string | Record<string, unknown>, options?: JWTSignOption): string | null {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user