improvements + updated README

This commit is contained in:
daniel31x13
2023-11-20 15:58:32 -05:00
parent 5968bc6c9c
commit 557494747d
17 changed files with 32 additions and 22 deletions
@@ -31,13 +31,16 @@ export default async function getPublicUser(
if (user?.isPrivate) {
if (requestingId) {
const requestingUsername = (
await prisma.user.findUnique({ where: { id: requestingId } })
)?.username;
const requestingUser = await prisma.user.findUnique({
where: { id: requestingId },
});
if (
!requestingUsername ||
!whitelistedUsernames.includes(requestingUsername?.toLowerCase())
requestingUser?.id !== requestingId &&
(!requestingUser?.username ||
!whitelistedUsernames.includes(
requestingUser.username?.toLowerCase()
))
) {
return {
response: "User not found or profile is private.",