mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-10 10:11:47 +00:00
Fix linting
This commit is contained in:
@ -66,9 +66,9 @@ export const getProjectUnsafe = async (projectId: string): Promise<IProject | nu
|
||||
}
|
||||
|
||||
export const createProject = (name: string, userId: string) => {
|
||||
return new Promise((resolve, reject) => generateKeyPair('rsa', {
|
||||
modulusLength: 4096, publicKeyEncoding: {type: 'spki', format: 'pem'},
|
||||
privateKeyEncoding: {type: 'pkcs8', format: 'pem'}
|
||||
return new Promise((resolve, reject) => generateKeyPair("rsa", {
|
||||
modulusLength: 4096, publicKeyEncoding: {type: "spki", format: "pem"},
|
||||
privateKeyEncoding: {type: "pkcs8", format: "pem"}
|
||||
}, async (err, publicKey, privateKey) => {
|
||||
if (err) return reject({code: 5000, message: "An error occurred while generating the key pair"});
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ export const signOfflineKey = async (validationKey: string, licenseKey: string)
|
||||
const signature = signer.sign(project.privateKey, "hex");
|
||||
|
||||
let content = JSON.stringify({signature, data: {...license.license, renewalDate}});
|
||||
content = Buffer.from(content).toString('base64').replace(/(.{64})/g, "$1\n");
|
||||
content = Buffer.from(content).toString("base64").replace(/(.{64})/g, "$1\n");
|
||||
|
||||
const file = `-----BEGIN LICENSE KEY-----\n${content}\n-----END LICENSE KEY-----`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user