From 91c5574866a7494cff812edd7e24c395fb5e5f17 Mon Sep 17 00:00:00 2001 From: tomast1337 Date: Sat, 18 Jan 2025 17:53:50 -0300 Subject: [PATCH] feat: add prompt option to Discord strategy configuration --- .../auth/strategies/discord.strategy/DiscordStrategyConfig.ts | 4 ++++ server/src/auth/strategies/discord.strategy/index.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/server/src/auth/strategies/discord.strategy/DiscordStrategyConfig.ts b/server/src/auth/strategies/discord.strategy/DiscordStrategyConfig.ts index 8bae3186..6146e2c9 100644 --- a/server/src/auth/strategies/discord.strategy/DiscordStrategyConfig.ts +++ b/server/src/auth/strategies/discord.strategy/DiscordStrategyConfig.ts @@ -1,6 +1,7 @@ import { IsArray, IsBoolean, + IsEnum, IsNumber, IsOptional, IsString, @@ -49,6 +50,9 @@ export class DiscordStrategyConfig implements DiscordStrategyOptions { @IsBoolean() fetchScope?: boolean; + @IsEnum(['none', 'consent']) + prompt: 'consent' | 'none'; + // The separator for the scope values. @IsOptional() @IsString() diff --git a/server/src/auth/strategies/discord.strategy/index.ts b/server/src/auth/strategies/discord.strategy/index.ts index 1a91f16a..61dc578a 100644 --- a/server/src/auth/strategies/discord.strategy/index.ts +++ b/server/src/auth/strategies/discord.strategy/index.ts @@ -27,6 +27,7 @@ export class DiscordStrategy extends PassportStrategy(strategy, 'discord') { callbackUrl: `${SERVER_URL}/api/v1/auth/discord/callback`, scope: [DiscordPermissionScope.Email, DiscordPermissionScope.Identify], fetchScope: true, + prompt: 'none', }; super(config);