refactor: migrate authentication to NextAuth and clean up related services
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { TeamReviewService } from "@/services/team-review-service";
|
||||
import { AuthService } from "@/services/auth-service";
|
||||
import { auth } from "@/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import { TeamOverview } from "@/components/team-review/team-overview";
|
||||
import { SkillMatrix } from "@/components/team-review/skill-matrix";
|
||||
@@ -13,10 +13,14 @@ export const dynamic = "force-dynamic";
|
||||
|
||||
async function TeamReviewPage() {
|
||||
try {
|
||||
const { userProfile } = await AuthService.requireAuthenticatedUser();
|
||||
const session = await auth();
|
||||
|
||||
if (!session?.user) {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
const teamData = await TeamReviewService.getTeamReviewData(
|
||||
userProfile.teamId
|
||||
session.user.teamId
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user