Skip to content

Conversation

@alexandrudanpop
Copy link
Contributor

Fixes OPS-3453

Use state param with BroadcastChannel to intercept the payload we need to store in the form

Copilot AI review requested due to automatic review settings January 20, 2026 14:32
@linear
Copy link

linear bot commented Jan 20, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Slack OAuth2 connection flow by implementing a state parameter with BroadcastChannel for secure communication between the OAuth popup and the parent window.

Changes:

  • Added state parameter generation and validation to the OAuth2 flow
  • Implemented BroadcastChannel as the primary communication method with postMessage fallback
  • Refactored the getCode function to handle both communication mechanisms with proper cleanup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
};
} catch {
console.warn('BroadcastChannel not supported...');
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message 'BroadcastChannel not supported...' with trailing ellipsis is vague and doesn't inform the user about fallback behavior. Consider changing to something like 'BroadcastChannel not supported, falling back to postMessage' to clarify that the functionality will still work.

Suggested change
console.warn('BroadcastChannel not supported...');
console.warn('BroadcastChannel not supported, falling back to postMessage');

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants