[CORRUPTED] Synthetic Benchmark PR #1926 - [bench] feat: discord concierge oauth2 integration - #2
Open
amirzaushnizer wants to merge 12 commits into
Open
Conversation
Replace invite link approach with Discord OAuth2 flow. Users now authorize via Discord to gain channel access, solving the issue of invite links not granting private channel permissions. Implements CSRF token validation, user/guild addition, and per-user channel access via permission overwrites.
… OAuth callback Eliminates fragile NEXT_REDIRECT string check by computing the redirect URL inside try/catch and calling redirect() after. Replaces console.log debug statements with logger.error for the error path.
…aned channels Channel was being created on button click before OAuth, leaving floating channels when users abandoned the flow. Now the channel is only created in the callback after successful authorization.
…l redirect - Replace raw Drizzle update with updateOrganization tableMethod in OAuth callback - Re-read org after update to handle concurrent race conditions correctly - Use window.location.href instead of router.push for external Discord OAuth URL - Remove unused useRouter import from DiscordConciergeLink
- Log errors in Discord OAuth callback catch block for production debugging - Add Zod schema validation on Discord token exchange response - Replace hardcoded Discord API URL with RouteBases.api + Routes.user() - Remove unsafe type cast in OAuth state test using getdel override
Thread discordUserId through getOrCreateConciergeChannel to buildWelcomeMessage so the welcome message @mentions the specific user who joined. This creates an unread notification badge on the channel, making it visible in their sidebar even if the category is collapsed. Falls back to @here when no user ID is available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR flowglad#1926
Type: Corrupted (contains bugs)
Original PR Title: [bench] feat: discord concierge oauth2 integration
Original PR Description: Reconstructed for skills benchmark from flowglad#1926
Original PR URL: flowglad#1926