diff --git a/package-lock.json b/package-lock.json index 764febb0..6107b5fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,8 +24,8 @@ "passport": "^0.6.0", "passport-google-oauth20": "^2.0.0", "passport-jwt": "^4.0.1", - "pdf-lib": "^1.17.1", "passport-linkedin-oauth2": "github:auth0/passport-linkedin-oauth2#v3.0.0", + "pdf-lib": "^1.17.1", "pg": "^8.10.0", "reflect-metadata": "^0.1.13", "ts-node": "^10.9.1", @@ -10778,6 +10778,7 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } diff --git a/package.json b/package.json index 3c95e8f4..5ce838c9 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "passport": "^0.6.0", "passport-google-oauth20": "^2.0.0", "passport-jwt": "^4.0.1", - "pdf-lib": "^1.17.1", "passport-linkedin-oauth2": "github:auth0/passport-linkedin-oauth2#v3.0.0", + "pdf-lib": "^1.17.1", "pg": "^8.10.0", "reflect-metadata": "^0.1.13", "ts-node": "^10.9.1", diff --git a/src/utils.ts b/src/utils.ts index d76279d1..b86c7b7e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -7,8 +7,7 @@ import multer from 'multer' import ejs from 'ejs' import { ApplicationStatus } from './enums' import { generateCertificate } from './services/admin/generateCertificate' -import { v4 as uuidv4 } from 'uuid' - +import { randomUUID } from 'crypto' export const signAndSetCookie = (res: Response, uuid: string): void => { const token = jwt.sign({ userId: uuid }, JWT_SECRET ?? '') @@ -177,7 +176,7 @@ export const getEmailContent = async ( Thank you again for considering our program and for the time you invested in your application. We wish you all the best in your future endeavours.` } case ApplicationStatus.COMPLETED: { - const uniqueId = uuidv4() + const uniqueId = randomUUID() const pdfFileName = await generateCertificate( name, './src/certificates/certificate_template.pdf',