5 weight: ["400", "700"],6});78export default function Layout({ children }: { children: React.ReactNode }) {9 return <div className={`${league_spartan.className} blog-root`}>{children}</div>;10}11
5 weight: ["400", "700"],6});78export default function Layout({ children }: { children: React.ReactNode }) {9 return(10 <div className={`${league_spartan.className} blog-root`}>{children}</div>11);
11 getCurrentUser,12 updateAnswer,13 updateComment,14 updateQuestion,15validateName,16 voteAnswer,17 voteComment,18 voteQuestion,19} from "@/lib/dal";
11 getCurrentUser,12 updateAnswer,13 updateComment,14 updateQuestion,15validateUsername,16 voteAnswer,17 voteComment,18 voteQuestion,19} from "@/lib/dal";
39 const email = formData.get("email") as string;40 const name = formData.get("name") as string;41 const password = formData.get("password") as string;4243 constvalidateResult = await
6 type UserResponse,7 UserResponseSchema,8} from "../dto";9import { getSession } from "../supabase";10import { authFetch, GITDOT_SERVER_URL, handleResponse, NotFound } from "./util";1112exporttypeValidateNameResult={success:true}|{error:string};1314export async functionvalidateName(name: string): Promise<ValidateNameResult> {15 const response = awaitfetch(16`${GITDOT_SERVER_URL}/user/${encodeURIComponent(name)}/validate`,17{method:"POST"},18 );1920if(!response.ok){21try{22constdata=awaitresponse.json();23return{error:data.message??"Invalid name"};24}catch{
6 type UserResponse,7 UserResponseSchema,8} from "../dto";9import { getSession } from "../supabase";10import { authFetch,authHead, GITDOT_SERVER_URL, handleResponse, NotFound } from "./util";....1112export async
80 const pathname = request.nextUrl.pathname;81 if (user && (pathname === "/login" || pathname === "/signup")) {82 return NextResponse.redirect(new URL("/home", request.nextUrl));83 } else if (!user && pathname === "/oauth/device") {84 return NextResponse.redirect(new URL("/login?redirect=/oauth/device", request.nextUrl));..85 }8687 // return the supabaseResponse object as-is, this is required to ensure that cookies are in sync between the server and client.88 return supabaseResponse;