mirror of
https://github.com/R0m1k3/podcastic.git
synced 2026-10-24 15:38:03 +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": {
|
"devDependencies": {
|
||||||
"@types/express": "^4.17.20",
|
"@types/express": "^4.17.20",
|
||||||
"@types/node": "^20.8.0",
|
"@types/node": "^20.8.0",
|
||||||
|
"@types/cors": "^2.8.17",
|
||||||
"@types/jsonwebtoken": "^9.0.4",
|
"@types/jsonwebtoken": "^9.0.4",
|
||||||
"@types/bcryptjs": "^2.4.2",
|
"@types/bcryptjs": "^2.4.2",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import jwt from 'jsonwebtoken';
|
import jwt from 'jsonwebtoken';
|
||||||
import { IUser } from '../models/User';
|
import { IUser } from '../models/User';
|
||||||
|
|
||||||
|
import type { SignOptions } from 'jsonwebtoken';
|
||||||
|
|
||||||
const JWT_SECRET = process.env.JWT_SECRET || 'dev_secret_key';
|
const JWT_SECRET = process.env.JWT_SECRET || 'dev_secret_key';
|
||||||
const JWT_EXPIRES_IN = process.env.JWT_EXPIRES_IN || '7d';
|
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';
|
const JWT_REFRESH_EXPIRES_IN = (process.env.JWT_REFRESH_EXPIRES_IN || '30d') as SignOptions['expiresIn'];
|
||||||
|
|
||||||
export interface JwtPayload {
|
export interface JwtPayload {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
Reference in new issue
Block a user