From cd04773504b4d6f79bfdc9ea33bc8c86926deffe Mon Sep 17 00:00:00 2001 From: topchetoeu <36534413+TopchetoEU@users.noreply.github.com> Date: Thu, 29 Jun 2023 17:25:58 +0300 Subject: [PATCH] fix: typescript sux --- src/server/decorators/jwt.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/decorators/jwt.ts b/src/server/decorators/jwt.ts index 5eeacb6..8c9986e 100644 --- a/src/server/decorators/jwt.ts +++ b/src/server/decorators/jwt.ts @@ -1,13 +1,13 @@ +// SHUT THE FUCK UP +// deno-lint-ignore-file no-explicit-any import JWT from "../../utils/JWT.ts"; import HttpError from "../HttpError.ts"; import Router, { makeParameterModifier } from "../Router.ts"; -// SHUT THE FUCK UP -// deno-lint-ignore no-explicit-any -export default function jwt(salt: ((self: T) => string) | keyof T, required = false) { +export default function jwt(salt: ((self: T) => string) | string, required = false) { return makeParameterModifier(function (_req, val?: string) { if (val === undefined) return undefined; - const s = typeof salt === 'function' ? salt(this) : this[salt] as string; + const s = typeof salt === 'function' ? salt(this) : (this as any)[salt] as string; try { const res = JWT.decode(val, s); if (required && res === undefined) throw new HttpError('You are not logged in.');