avatar to main merge
I have completed the character creation screen on the avatar branch and am preparing to merge it into main.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import {
|
||||
hasCompletedOnboarding,
|
||||
requireSessionUser,
|
||||
} from "@/lib/auth-helpers";
|
||||
import { requireSessionUser } from "@/lib/auth-helpers";
|
||||
import { fetchOnboardingStatusForUser } from "@/lib/onboarding-status";
|
||||
import { routes } from "@/lib/routes";
|
||||
import { createClient } from "@/lib/supabase/server";
|
||||
|
||||
type OnboardingAuthGateProps = {
|
||||
children: React.ReactNode;
|
||||
@@ -12,8 +11,10 @@ type OnboardingAuthGateProps = {
|
||||
|
||||
export async function OnboardingAuthGate({ children }: OnboardingAuthGateProps) {
|
||||
const user = await requireSessionUser();
|
||||
const supabase = await createClient();
|
||||
const status = await fetchOnboardingStatusForUser(user.id, supabase);
|
||||
|
||||
if (hasCompletedOnboarding(user)) {
|
||||
if (status.appComplete) {
|
||||
redirect(routes.avatar);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user