mirror of
https://github.com/woodchen-ink/Q58Connect.git
synced 2025-07-18 14:01:55 +08:00
refactor: Remove unnecessary client directives and simplify server-side code
This commit is contained in:
parent
07ad2284cd
commit
77d00fd513
6747
package-lock.json
generated
6747
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import type { ExtendedAccessToken, ExtendedClient } from "@/types";
|
||||
|
@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import { redirect } from "next/navigation";
|
||||
import type { ExtendedAccessToken } from "@/types";
|
||||
import { Search } from "lucide-react";
|
||||
|
@ -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;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user