Merge pull request #44 from chrisbenseler/main

This commit is contained in:
Bailey Pumfleet 2021-04-17 22:28:53 +01:00 committed by GitHub
commit b7d9f85eab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View file

@ -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
}
});

View file

@ -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
},
});

View file

@ -9,10 +9,10 @@ export default function Home(props) {
if (loading) {
return <p className="text-gray-400">Loading...</p>;
} else {
if (!session) {
window.location.href = "/auth/login";
}
}
if (!session) {
window.location.href = "/auth/login";
return;
}
return(