From 8d428d90a8c50ac2b397cf3da026df30f8d02b60 Mon Sep 17 00:00:00 2001 From: slice Date: Wed, 26 Apr 2023 20:32:52 -0700 Subject: [PATCH] borgus --- .../migration.sql | 8 ++++++++ prisma/schema.prisma | 2 +- src/app/me/AboutMe.tsx | 8 ++++++++ src/app/oauth/discord/redirect/route.ts | 17 ++++++++++++----- src/app/oauth/github/redirect/route.ts | 13 ++++++++++++- src/components/AvatarChanger.module.css | 4 ++-- src/ldap.ts | 16 ++++++++++++++++ 7 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 prisma/migrations/20230427033108_make_username_unique/migration.sql diff --git a/prisma/migrations/20230427033108_make_username_unique/migration.sql b/prisma/migrations/20230427033108_make_username_unique/migration.sql new file mode 100644 index 0000000..54942a5 --- /dev/null +++ b/prisma/migrations/20230427033108_make_username_unique/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - A unique constraint covering the columns `[username]` on the table `User` will be added. If there are existing duplicate values, this will fail. + +*/ +-- CreateIndex +CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 6699e0c..fcf95a9 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -18,7 +18,7 @@ model AuthTicket { model User { id Int @id @default(autoincrement()) - username String? + username String? @unique authTicket AuthTicket? discordAuth DiscordAuth? diff --git a/src/app/me/AboutMe.tsx b/src/app/me/AboutMe.tsx index 85df785..b921c5f 100644 --- a/src/app/me/AboutMe.tsx +++ b/src/app/me/AboutMe.tsx @@ -226,6 +226,14 @@ export default function AboutMe({ info }: { info: UserInfo }) { )} + +
+

Connections

+
+

discord: {info.discordId}

+

github: {info.githubId}

+
+