MCPcopy
hub / github.com/john-smilga/react-course-v3 / getAuthUser

Function getAuthUser

16-nextjs-store/utils/actions.ts:15–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13import { revalidatePath } from 'next/cache';
14import { Cart } from '@prisma/client';
15const getAuthUser = async () => {
16 const user = await currentUser();
17 if (!user) redirect('/');
18 return user;
19};
20
21const getAdminUser = async () => {
22 const user = await getAuthUser();

Callers 14

getAdminUserFunction · 0.85
createProductActionFunction · 0.85
updateProductImageActionFunction · 0.85
fetchFavoriteIdFunction · 0.85
toggleFavoriteActionFunction · 0.85
fetchUserFavoritesFunction · 0.85
createReviewActionFunction · 0.85
deleteReviewActionFunction · 0.85
addToCartActionFunction · 0.85
removeCartItemActionFunction · 0.85
updateCartItemActionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected