mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
feat: usernames
also change userId to number
This commit is contained in:
parent
9344f2f315
commit
9d35d93d9e
15 changed files with 200 additions and 78 deletions
22
src/app/create-username/page.tsx
Normal file
22
src/app/create-username/page.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue