temp: firebase deployment progress
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import express from 'express';
|
||||
import { authenticateToken } from '../middleware/auth';
|
||||
import { verifyFirebaseToken } from '../middleware/firebaseAuth';
|
||||
import { documentController } from '../controllers/documentController';
|
||||
import { unifiedDocumentProcessor } from '../services/unifiedDocumentProcessor';
|
||||
import { logger } from '../utils/logger';
|
||||
@@ -11,11 +11,7 @@ import { DocumentModel } from '../models/DocumentModel';
|
||||
declare global {
|
||||
namespace Express {
|
||||
interface Request {
|
||||
user?: {
|
||||
id: string;
|
||||
email: string;
|
||||
role: string;
|
||||
};
|
||||
user?: import('firebase-admin').auth.DecodedIdToken;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +19,7 @@ declare global {
|
||||
const router = express.Router();
|
||||
|
||||
// Apply authentication to all routes
|
||||
router.use(authenticateToken);
|
||||
router.use(verifyFirebaseToken);
|
||||
|
||||
// Essential document management routes (keeping these)
|
||||
router.post('/upload', handleFileUpload, documentController.uploadDocument);
|
||||
@@ -36,7 +32,7 @@ router.delete('/:id', documentController.deleteDocument);
|
||||
// Analytics endpoints (keeping these for monitoring)
|
||||
router.get('/analytics', async (req, res) => {
|
||||
try {
|
||||
const userId = req.user?.id;
|
||||
const userId = req.user?.uid;
|
||||
if (!userId) {
|
||||
return res.status(401).json({ error: 'User not authenticated' });
|
||||
}
|
||||
@@ -67,7 +63,7 @@ router.get('/processing-stats', async (_req, res) => {
|
||||
// Download endpoint (keeping this)
|
||||
router.get('/:id/download', async (req, res) => {
|
||||
try {
|
||||
const userId = req.user?.id;
|
||||
const userId = req.user?.uid;
|
||||
if (!userId) {
|
||||
return res.status(401).json({ error: 'User not authenticated' });
|
||||
}
|
||||
@@ -106,7 +102,7 @@ router.get('/:id/download', async (req, res) => {
|
||||
router.post('/:id/process-optimized-agentic-rag', async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const userId = req.user?.id;
|
||||
const userId = req.user?.uid;
|
||||
|
||||
if (!userId) {
|
||||
return res.status(401).json({ error: 'User not authenticated' });
|
||||
@@ -147,7 +143,7 @@ router.post('/:id/process-optimized-agentic-rag', async (req, res) => {
|
||||
router.get('/:id/agentic-rag-sessions', async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const userId = req.user?.id;
|
||||
const userId = req.user?.uid;
|
||||
|
||||
if (!userId) {
|
||||
return res.status(401).json({ error: 'User not authenticated' });
|
||||
@@ -183,7 +179,7 @@ router.get('/:id/agentic-rag-sessions', async (req, res) => {
|
||||
router.get('/agentic-rag-sessions/:sessionId', async (req, res) => {
|
||||
try {
|
||||
const { sessionId } = req.params;
|
||||
const userId = req.user?.id;
|
||||
const userId = req.user?.uid;
|
||||
|
||||
if (!userId) {
|
||||
return res.status(401).json({ error: 'User not authenticated' });
|
||||
@@ -245,7 +241,7 @@ router.get('/agentic-rag-sessions/:sessionId', async (req, res) => {
|
||||
router.get('/:id/analytics', async (req, res) => {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const userId = req.user?.id;
|
||||
const userId = req.user?.uid;
|
||||
|
||||
if (!userId) {
|
||||
return res.status(401).json({ error: 'User not authenticated' });
|
||||
|
||||
Reference in New Issue
Block a user