setting up files
This commit is contained in:
19
components/layout/logged-in-redirect.tsx
Normal file
19
components/layout/logged-in-redirect.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import {
|
||||
getSessionUser,
|
||||
hasCompletedOnboarding,
|
||||
} from "@/lib/auth-helpers";
|
||||
import { routes } from "@/lib/routes";
|
||||
|
||||
export async function LoggedInRedirect() {
|
||||
const user = await getSessionUser();
|
||||
|
||||
if (user) {
|
||||
redirect(
|
||||
hasCompletedOnboarding(user) ? routes.avatar : routes.onboardingQuiz,
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user