- Upgrading to Vite 7

- Refactor to use es modules
- Added permission mode
- Switched to better sqlite3
- several UX enhancements
This commit is contained in:
simos
2025-07-11 10:29:36 +00:00
parent d8bc6348d5
commit fc2a94a2e5
16 changed files with 581 additions and 1465 deletions

View File

@@ -1,5 +1,5 @@
const jwt = require('jsonwebtoken');
const { userDb } = require('../database/db');
import jwt from 'jsonwebtoken';
import { userDb } from '../database/db.js';
// Get JWT secret from environment or use default (for development)
const JWT_SECRET = process.env.JWT_SECRET || 'claude-ui-dev-secret-change-in-production';
@@ -31,7 +31,7 @@ const authenticateToken = async (req, res, next) => {
const decoded = jwt.verify(token, JWT_SECRET);
// Verify user still exists and is active
const user = await userDb.getUserById(decoded.userId);
const user = userDb.getUserById(decoded.userId);
if (!user) {
return res.status(401).json({ error: 'Invalid token. User not found.' });
}
@@ -71,7 +71,7 @@ const authenticateWebSocket = (token) => {
}
};
module.exports = {
export {
validateApiKey,
authenticateToken,
generateToken,