13 lines
352 B
TypeScript
13 lines
352 B
TypeScript
import { getSessionUserId } from "@/lib/auth/session";
|
|
import { findUserById } from "@/lib/user/repository";
|
|
|
|
export async function getCurrentUser() {
|
|
const userId = await getSessionUserId();
|
|
if (!userId) return null;
|
|
return findUserById(userId);
|
|
}
|
|
|
|
export async function getUser(id: string) {
|
|
if (!id) return null;
|
|
return findUserById(id);
|
|
} |