From bee91fe06db62f818b2cf6498f205873ada36987 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 8 Apr 2025 22:00:33 -0400 Subject: [PATCH] fix: Allow OIDC without team name --- plugins/discord/server/auth/discord.ts | 2 +- server/commands/accountProvisioner.test.ts | 2 -- server/commands/accountProvisioner.ts | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/discord/server/auth/discord.ts b/plugins/discord/server/auth/discord.ts index 68ca804c3f..868b1065bb 100644 --- a/plugins/discord/server/auth/discord.ts +++ b/plugins/discord/server/auth/discord.ts @@ -94,7 +94,7 @@ if (env.DISCORD_CLIENT_ID && env.DISCORD_CLIENT_SECRET) { /** Default user and team names metadata */ let userName = profile.username; - let teamName = "Wiki"; + let teamName; let userAvatarUrl: string = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.png`; let teamAvatarUrl: string | undefined = undefined; let subdomain = slugifyDomain(domain); diff --git a/server/commands/accountProvisioner.test.ts b/server/commands/accountProvisioner.test.ts index 6adc22e9a0..eac8bd16fa 100644 --- a/server/commands/accountProvisioner.test.ts +++ b/server/commands/accountProvisioner.test.ts @@ -264,7 +264,6 @@ describe("accountProvisioner", () => { avatarUrl: faker.internet.avatar(), }, team: { - name: existingTeam.name, avatarUrl: existingTeam.avatarUrl, subdomain: faker.internet.domainWord(), }, @@ -308,7 +307,6 @@ describe("accountProvisioner", () => { avatarUrl: faker.internet.avatar(), }, team: { - name: team.name, avatarUrl: team.avatarUrl, subdomain: faker.internet.domainWord(), }, diff --git a/server/commands/accountProvisioner.ts b/server/commands/accountProvisioner.ts index 0e02f03bcf..5668265939 100644 --- a/server/commands/accountProvisioner.ts +++ b/server/commands/accountProvisioner.ts @@ -43,7 +43,7 @@ type Props = { */ teamId?: string; /** The displayed name of the team */ - name: string; + name?: string; /** The domain name from the email of the user logging in */ domain?: string; /** The preferred subdomain to provision for the team if not yet created */ @@ -92,6 +92,7 @@ async function accountProvisioner({ try { result = await teamProvisioner({ + name: "Wiki", ...teamParams, authenticationProvider: authenticationProviderParams, ip,