fix: add @types/cors and fix jwt expiresIn type

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Haiku 4.5 committed 2026-04-16 10:58:11 +02:00
1 parent faec1f37b4
commit ffb85ade90
2 files changed
+5 -2

No files matched your search

+1
View File
@@ -29,6 +29,7 @@
"devDependencies": {
"@types/express": "^4.17.20",
"@types/node": "^20.8.0",
"@types/cors": "^2.8.17",
"@types/jsonwebtoken": "^9.0.4",
"@types/bcryptjs": "^2.4.2",
"typescript": "^5.2.2",
+4 -2
View File
@@ -1,9 +1,11 @@
import jwt from 'jsonwebtoken';
import { IUser } from '../models/User';
import type { SignOptions } from 'jsonwebtoken';
const JWT_SECRET = process.env.JWT_SECRET || 'dev_secret_key';
const JWT_EXPIRES_IN = process.env.JWT_EXPIRES_IN || '7d';
const JWT_REFRESH_EXPIRES_IN = process.env.JWT_REFRESH_EXPIRES_IN || '30d';
const JWT_EXPIRES_IN = (process.env.JWT_EXPIRES_IN || '7d') as SignOptions['expiresIn'];
const JWT_REFRESH_EXPIRES_IN = (process.env.JWT_REFRESH_EXPIRES_IN || '30d') as SignOptions['expiresIn'];
export interface JwtPayload {
id: string;