mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 12:50:09 +00:00
Implement centralized logging with RMABLogger
Replaces scattered console statements with a unified RMABLogger across backend API routes and services. Adds LOG_LEVEL-based filtering, job-aware database persistence, and context-based logging. Updates documentation to describe the new logging system and usage patterns. Also documents qBittorrent CSRF header fix
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { verifyRefreshToken, generateAccessToken } from '@/lib/utils/jwt';
|
||||
import { prisma } from '@/lib/db';
|
||||
import { RMABLogger } from '@/lib/utils/logger';
|
||||
|
||||
const logger = RMABLogger.create('API.Auth.Refresh');
|
||||
|
||||
/**
|
||||
* POST /api/auth/refresh
|
||||
@@ -68,7 +71,7 @@ export async function POST(request: NextRequest) {
|
||||
expiresIn: 3600, // 1 hour in seconds
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to refresh token:', error);
|
||||
logger.error('Failed to refresh token', { error: error instanceof Error ? error.message : String(error) });
|
||||
return NextResponse.json(
|
||||
{
|
||||
error: 'RefreshError',
|
||||
|
||||
Reference in New Issue
Block a user