diff --git a/backend/prisma/migrations/20260218150104_add_user_full_name/migration.sql b/backend/prisma/migrations/20260218150104_add_user_full_name/migration.sql new file mode 100644 index 0000000..24749f7 --- /dev/null +++ b/backend/prisma/migrations/20260218150104_add_user_full_name/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "users" ADD COLUMN "full_name" VARCHAR(255); diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index 385c4be..fb41269 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -10,6 +10,7 @@ datasource db { model User { id String @id @db.VarChar(255) username String @db.VarChar(255) + fullName String? @db.VarChar(255) @map("full_name") email String @db.VarChar(255) createdAt DateTime @default(now()) @map("created_at") updatedAt DateTime @updatedAt @map("updated_at") diff --git a/backend/src/auth/oidc.ts b/backend/src/auth/oidc.ts index 2674ea9..e81bd96 100644 --- a/backend/src/auth/oidc.ts +++ b/backend/src/auth/oidc.ts @@ -92,6 +92,7 @@ export async function getUserInfo(tokenSet: TokenSet): Promise { where: { id: user.id }, update: { username: user.username, + fullName: user.fullName, email: user.email, }, create: { id: user.id, username: user.username, + fullName: user.fullName, email: user.email, }, }); diff --git a/backend/src/types/index.ts b/backend/src/types/index.ts index 40cfb6a..9559edb 100644 --- a/backend/src/types/index.ts +++ b/backend/src/types/index.ts @@ -3,6 +3,7 @@ import { Request } from 'express'; export interface AuthenticatedUser { id: string; username: string; + fullName: string | null; email: string; } diff --git a/frontend/src/components/Layout.tsx b/frontend/src/components/Layout.tsx index d52b59b..508398f 100644 --- a/frontend/src/components/Layout.tsx +++ b/frontend/src/components/Layout.tsx @@ -6,8 +6,8 @@ export function Layout() { return (
-
-
+
+
diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index 1133d81..a86fbda 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -114,8 +114,8 @@ export function Navbar() {
- - {user?.username} + + {user?.fullName || user?.username}