feat: usernames

also change userId to number
This commit is contained in:
trafficlunar 2025-03-30 17:36:49 +01:00
parent 9344f2f315
commit 9d35d93d9e
15 changed files with 200 additions and 78 deletions

View file

@ -0,0 +1,22 @@
import { auth } from "@/lib/auth";
import UsernameForm from "../components/username-form";
import { redirect } from "next/navigation";
export default async function CreateUsernamePage() {
const session = await auth();
// If the user is not logged in or already has a username, redirect
if (!session || session?.user.username) {
redirect("/");
}
return (
<div>
<h1 className="text-3xl font-medium text-center">Welcome to TomodachiShare!</h1>
<h2 className="text-lg text-center">Please create a username</h2>
<UsernameForm />
</div>
);
}