Fix oauth, again - #280
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new workspace restriction relies on a confusingly named env var (ALLOWED_TEAM_DOMAIN holding a team ID), which needs clearer naming/clarification to avoid real-world misconfiguration.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the Slack OpenID Connect login flow to constrain authentication to a specific Slack workspace and aligns setup documentation accordingly, reducing OAuth misconfiguration and unauthorized-workspace attempts.
Changes:
- Adds a
teamparameter to the Slack OpenID Connect authorize redirect and requires the allowlisted workspace identifier to be configured. - Expands controller tests to assert the new query parameter and configuration error path.
- Updates README Slack app configuration guidance and backend env var guidance.
File summaries
| File | Description |
|---|---|
| README.md | Updates Slack OAuth configuration instructions and the expected env var value description. |
| packages/backend/src/auth/auth.controller.ts | Adds workspace restriction (team param) and requires allowlist env var for /slack initiation. |
| packages/backend/src/auth/auth.controller.spec.ts | Adds assertions and a new test case covering missing allowlist env var. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| # Search & Auth | ||
| ALLOWED_TEAM_DOMAIN=your-workspace-domain | ||
| ALLOWED_TEAM_DOMAIN=your-slack-team-id |
Comment on lines
40
to
45
| const clientId = process.env.SLACK_CLIENT_ID; | ||
| const redirectUri = process.env.SLACK_REDIRECT_URI; | ||
| const teamId = process.env.ALLOWED_TEAM_DOMAIN; | ||
|
|
||
| if (!clientId || !redirectUri) { | ||
| if (!clientId || !redirectUri || !teamId) { | ||
| res.status(500).send('Slack OAuth is not configured'); |
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.
No description provided.