Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(api): reject unclaimed guild creation before the email verification gate (#1689)

Hampuse0bb10d5b750
diff --git a/fluxer_api/src/api/guild/controllers/GuildBaseController.ts b/fluxer_api/src/api/guild/controllers/GuildBaseController.ts
index af3dfe531..b40059cb4 100644
--- a/fluxer_api/src/api/guild/controllers/GuildBaseController.ts
+++ b/fluxer_api/src/api/guild/controllers/GuildBaseController.ts
@@ -50,7 +50,9 @@ export function GuildBaseController(app: HonoApp) {
if (policy.single_community_enabled) {
throw new SingleCommunityCannotCreateGuildsError();
}
- requireEmailVerified(user, 'guild_creation');
+ if (!user.isUnclaimedAccount()) {
+ requireEmailVerified(user, 'guild_creation');
+ }
const auditLogReason = ctx.get('auditLogReason') ?? null;
const locale = ctx.get('requestLocale') ?? null;
return ctx.json(await ctx.get('guildService').data.createGuild({user, data, locale}, auditLogReason));