fix(critique): 2 régressions introduites par les fixes précédents
Bug #1 — Memory Echo cassé (runtime crash): - lib/ai/services/memory-echo.service.ts: lignes adjustedThreshold restaurées - Cause: sed console.log avait supprimé les lignes de définition - Effet: findConnections() crashait (ReferenceError) Bug #2 — Auth mobile totalement cassée (sécurité): - 14 routes app/api/mobile/*/: getMobileUserId(req) → await getMobileUserId(req) - Cause: verifyMobileToken devenu async mais callers non mis à jour - Effet: auth bypassée (Promise truthy au lieu de string) i18n: - searchModal.* + insightsView.* propagés dans 13 locales (EN fallback)
This commit is contained in:
@@ -11,7 +11,7 @@ const MODE_MAP: Record<string, 'clarify' | 'shorten' | 'improveStyle' | 'fix_gra
|
||||
}
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const userId = getMobileUserId(req)
|
||||
const userId = await getMobileUserId(req)
|
||||
if (!userId) return NextResponse.json({ error: 'Non autorisé' }, { status: 401 })
|
||||
|
||||
const { text, mode = 'improve' } = await req.json().catch(() => ({}))
|
||||
|
||||
@@ -5,7 +5,7 @@ import { getSystemConfig } from '@/lib/config'
|
||||
import { reserveUsageOrThrow, QuotaExceededError } from '@/lib/entitlements'
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const userId = getMobileUserId(req)
|
||||
const userId = await getMobileUserId(req)
|
||||
if (!userId) return NextResponse.json({ error: 'Non autorisé' }, { status: 401 })
|
||||
|
||||
const { content } = await req.json().catch(() => ({}))
|
||||
|
||||
@@ -3,7 +3,7 @@ import { getMobileUserId } from '@/lib/mobile-auth'
|
||||
import { getSystemConfig } from '@/lib/config'
|
||||
|
||||
export async function POST(req: NextRequest) {
|
||||
const userId = getMobileUserId(req)
|
||||
const userId = await getMobileUserId(req)
|
||||
if (!userId) return NextResponse.json({ error: 'Non autorisé' }, { status: 401 })
|
||||
|
||||
const formData = await req.formData().catch(() => null)
|
||||
|
||||
Reference in New Issue
Block a user