Critical Securities (5) fixes
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { sign as jwtSign, verify as jwtVerify } from 'hono/jwt';
|
||||
|
||||
const { JWT_SECRET } = process.env;
|
||||
|
||||
if (!JWT_SECRET || JWT_SECRET.length < 32) {
|
||||
throw new Error('JWT_SECRET must be set and at least 32 characters long. Generate one with: openssl rand -base64 32');
|
||||
}
|
||||
|
||||
function parseExpiration(expiration: string): number {
|
||||
const match = expiration.match(/^(\d+)([smhd])$/);
|
||||
if (!match) {
|
||||
|
||||
Reference in New Issue
Block a user