Skip to content

Commit 925c79f

Browse files
committed
feat: remove uuid
1 parent 15ef59a commit 925c79f

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"pg": "8.8.0",
2424
"reflect-metadata": "0.1.13",
2525
"type-graphql": "1.1.1",
26-
"typeorm": "0.3.10",
27-
"uuid": "8.3.2"
26+
"typeorm": "0.3.10"
2827
},
2928
"devDependencies": {
3029
"@types/bcryptjs": "2.4.2",
@@ -35,7 +34,6 @@
3534
"@types/koa__router": "^8.0.11",
3635
"@types/node": "18.7.6",
3736
"@types/nodemailer": "6.4.4",
38-
"@types/uuid": "8.3.4",
3937
"axios": "0.27.2",
4038
"jest": "28.1.2",
4139
"nodemon": "^2.0.20",

pnpm-lock.yaml

Lines changed: 13 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/SendEmail.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as nodemailer from 'nodemailer'
22
import { Redis } from 'ioredis'
3-
import { v4 } from 'uuid'
3+
import { randomUUID } from 'crypto';
44

55
export const sendEmail = async (recipient: string, url: string) => {
66
const transporter = nodemailer.createTransport({
@@ -36,7 +36,7 @@ export const sendEmail = async (recipient: string, url: string) => {
3636
}
3737

3838
export const createConfirmEmailLink = async (url: string, userId: string, redis: Redis) => {
39-
const id = v4()
39+
const id = randomUUID()
4040
await redis.set(id, userId, 'EX', 24 * 60 * 60)
4141
return `${url}/confirm/${id}`
4242
}

0 commit comments

Comments
 (0)