fixed my test page so quizzes are behind login page

This commit is contained in:
masongga
2026-05-23 19:05:25 -06:00
parent 2ed978197c
commit 9641b120e4
5 changed files with 38 additions and 17 deletions

View File

@@ -23,25 +23,10 @@ export const appNavItems = [
export type NavItem = (typeof appNavItems)[number];
const appPaths = [
routes.avatar,
routes.habits,
routes.dailyQuiz,
routes.shop,
routes.profile,
routes.onboardingQuiz,
] as const;
export function isAuthPath(pathname: string) {
return pathname.startsWith("/auth");
}
export function isPublicPath(pathname: string) {
return (
pathname === routes.home ||
isAuthPath(pathname) ||
appPaths.some(
(path) => pathname === path || pathname.startsWith(`${path}/`),
)
);
return pathname === routes.home || isAuthPath(pathname);
}