refactor: migrate authentication to NextAuth and clean up related services

This commit is contained in:
Julien Froidefond
2025-10-12 15:45:09 +02:00
parent 117ac243f5
commit 7d12a66c12
25 changed files with 558 additions and 353 deletions

View File

@@ -1,13 +1,20 @@
import { NextRequest, NextResponse } from "next/server";
import { TeamReviewService } from "@/services/team-review-service";
import { AuthService } from "@/services/auth-service";
import { auth } from "@/auth";
export async function GET(request: NextRequest) {
try {
// Vérifier l'authentification
const { userProfile } = await AuthService.requireAuthenticatedUser();
const session = await auth();
if (!session?.user) {
return NextResponse.json(
{ error: "Non authentifié" },
{ status: 401 }
);
}
const teamId = userProfile.teamId;
const teamId = session.user.teamId;
const data = await TeamReviewService.getTeamReviewData(teamId);
return NextResponse.json(data);