refactor: Remove unnecessary client directives and simplify server-side code

This commit is contained in:
wood chen 2025-02-20 00:25:09 +08:00
parent 07ad2284cd
commit 77d00fd513
4 changed files with 1 additions and 6757 deletions

6747
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,3 @@
"use client";
import Link from "next/link";
import { notFound, redirect } from "next/navigation";
import type { ExtendedAccessToken, ExtendedClient } from "@/types";

View File

@ -1,5 +1,3 @@
"use client";
import { redirect } from "next/navigation";
import type { ExtendedAccessToken } from "@/types";
import { Search } from "lucide-react";

View File

@ -1,12 +1,7 @@
import "server-only";
import { cache } from "react";
import { auth } from "@/auth";
export const getCurrentUser = cache(async () => {
const session = await auth();
if (!session?.user) {
return undefined;
}
return session.user;
return session?.user;
});