From 7019f233910896107c1685c9ad2ce745117626f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:28:16 +0000 Subject: [PATCH 1/2] chore(deps): update dependency @tsndr/cloudflare-worker-jwt to v2.3.2 --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b06b77ec..c9d370f5 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint:fix": "eslint . --fix" }, "dependencies": { - "@tsndr/cloudflare-worker-jwt": "2.2.5", + "@tsndr/cloudflare-worker-jwt": "2.3.2", "discord-api-types": "0.37.65", "discord-verify": "1.2.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7c22927..6796bbb7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@tsndr/cloudflare-worker-jwt': - specifier: 2.2.5 - version: 2.2.5 + specifier: 2.3.2 + version: 2.3.2 discord-api-types: specifier: 0.37.65 version: 0.37.65 @@ -485,8 +485,8 @@ packages: resolution: {integrity: sha512-jt4jIsWKvUvuY6adJnQJlb/UR7DdjC8CjHI/OaSQruj2yX9/K6+KOvDt/vD6udqos/FUk5Op66CvYT7TBLYO5Q==} dev: true - /@tsndr/cloudflare-worker-jwt@2.2.5: - resolution: {integrity: sha512-zK177o49c09sa8yEp2/OPfyh+I/SHY/SZ9kxYQC33F8PotrrZgJjY4X3yqu4BFX4lC7RYI1tSXBDQP9Yo9p6/w==} + /@tsndr/cloudflare-worker-jwt@2.3.2: + resolution: {integrity: sha512-g1jSm5olPqKh15kadnj0666YPudibHYGyFyM0URLXSeY5MzNIGkfhFedLgKHq8NCDBMzLUMX7Oz8d+jmQXqBuw==} dev: false /@types/body-parser@1.19.5: From 248aa625f0580d27abd0adb031d1d45018bc01fe Mon Sep 17 00:00:00 2001 From: Promise Date: Tue, 28 Nov 2023 08:11:02 +0000 Subject: [PATCH 2/2] fix(lint): Signed-off-by: Promise --- src/utils/webtoken.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/webtoken.ts b/src/utils/webtoken.ts index dd33dca5..f197fd41 100644 --- a/src/utils/webtoken.ts +++ b/src/utils/webtoken.ts @@ -1,13 +1,13 @@ -import jwt from "@tsndr/cloudflare-worker-jwt"; +import { sign as jwtSign, verify as jwtVerify, decode as jwtDecode } from "@tsndr/cloudflare-worker-jwt"; export function encode(payload: object): Promise { - return jwt.sign(payload, DISCORD_PUBLIC_KEY); + return jwtSign(payload, DISCORD_PUBLIC_KEY); } export function validate(token: string): Promise { - return jwt.verify(token, DISCORD_PUBLIC_KEY); + return jwtVerify(token, DISCORD_PUBLIC_KEY); } export function decode(token: string): T { - return jwt.decode(token).payload as T; + return jwtDecode(token).payload as T; }