diff --git a/pages/api/auth/signup.ts b/pages/api/auth/signup.ts index 0aae8331..d2427c0c 100644 --- a/pages/api/auth/signup.ts +++ b/pages/api/auth/signup.ts @@ -37,8 +37,8 @@ export default async function handler(req, res) { const user = await prisma.user.create({ data: { - username: username, - email: email, + username, + email, password: hashedPassword } }); diff --git a/pages/api/user/profile.ts b/pages/api/user/profile.ts index 88793a1f..0cd3b1e6 100644 --- a/pages/api/user/profile.ts +++ b/pages/api/user/profile.ts @@ -25,16 +25,16 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const username = req.body.username; const name = req.body.name; - const description = req.body.description; + const bio = req.body.description; const updateUser = await prisma.user.update({ where: { id: user.id, }, data: { - username: username, - name: name, - bio: description + username, + name, + bio }, }); diff --git a/pages/index.tsx b/pages/index.tsx index 002171e2..233da68e 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -9,10 +9,10 @@ export default function Home(props) { if (loading) { return

Loading...

; - } else { - if (!session) { - window.location.href = "/auth/login"; - } + } + if (!session) { + window.location.href = "/auth/login"; + return; } return(