1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-12 00:30:06 +00:00

fix: typescript errors

This commit is contained in:
M
2025-09-25 13:34:55 +02:00
parent 379ea604bc
commit 198cd79354
5 changed files with 10 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
import jwt from 'jsonwebtoken'
import User from '../model/User'
import { InfoJWT } from '../types/InfoJWT'
const isValidToken = async (
token: string,
@@ -11,7 +12,8 @@ const isValidToken = async (
jwt.verify(token, key, (err, decoded) => {
if (err) return reject(false)
if (decoded?.userId === userId && decoded?.clientId === clientId) {
const payload = decoded as InfoJWT
if (payload?.userId === userId && payload?.clientId === clientId) {
return resolve(true)
}