mirror of
https://github.com/siteboon/claudecodeui.git
synced 2025-12-13 21:59:37 +00:00
- Upgrading to Vite 7
- Refactor to use es modules - Added permission mode - Switched to better sqlite3 - several UX enhancements
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user