This commit is contained in:
Michael Freno
2025-12-16 22:42:05 -05:00
commit 8fb748f401
81 changed files with 4378 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { User } from "@/types/model-types";
import { ConnectionFactory } from "@/app/utils";
import { NextResponse } from "next/server";
export async function GET(
_: Request,
context: { params: Promise<{ id: string }> },
) {
try {
const conn = ConnectionFactory();
const userQuery = "SELECT * FROM User WHERE id =?";
const params = await context.params;
const userParams = [params.id];
const res = await conn.execute({ sql: userQuery, args: userParams });
if (res.rows[0]) {
const user = res.rows[0] as unknown as User;
if (user && user.display_name !== "user deleted")
return NextResponse.json(
{
id: user.id,
email: user.email,
emailVerified: user.email_verified,
image: user.image,
displayName: user.display_name,
provider: user.provider,
hasPassword: !!user.password_hash,
},
{ status: 202 },
);
}
return NextResponse.json({}, { status: 200 });
} catch (err) {
console.error(err);
return NextResponse.json({}, { status: 200 });
}
}