mirror of
https://github.com/R0m1k3/podcastic.git
synced 2026-10-11 17:26:20 +02:00
fix: add @types/cors and fix jwt expiresIn type
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
faec1f37b4
commit
ffb85ade90
2 files changed
+5
-2
No files matched your search
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user