-
Notifications
You must be signed in to change notification settings - Fork 317
[comp] Production Deploy #2470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
[comp] Production Deploy #2470
Changes from 6 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
16d7d99
chore: merge release v3.16.2 back to main [skip ci]
github-actions[bot] cb0e6af
fix(google-workspace): clarify that email filter variables apply to c…
tofikwest ecc04a6
Merge pull request #2469 from trycompai/fix/gws-variable-labels
tofikwest 52bb3f6
fix(documents): allow CSV and Excel file uploads for evidence forms
tofikwest c440317
fix(documents): fix RBAC schema, matrix validation, and step 3 MIME m…
tofikwest 5a90324
fix(notifications): dont send task reminders to employees
github-actions[bot] e1b29a5
fix(portal): sync activeOrganizationId when navigating between orgs (…
github-actions[bot] f06febb
fix(documents): use lenient row schema so file upload bypasses row va…
tofikwest edababd
Merge branch 'main' into worktree-fix+evidence-upload-csv-xlsx
tofikwest 7ded778
fix(documents): use original row index for validation error paths
tofikwest da7d2d0
chore(deps): update tiptap, lucide-react, electron and remove unused …
github-actions[bot] 6511fa1
Merge branch 'main' into worktree-fix+evidence-upload-csv-xlsx
tofikwest 77d71bd
fix(documents): fix TS strict index access on matrix row
tofikwest 68195a3
Merge pull request #2471 from trycompai/worktree-fix+evidence-upload-…
tofikwest b3d26e7
feat(trigger): add org tags to all trigger job runs (#2476)
Marfuen 3574357
fix(ci): pin bun version in trigger workflows and regenerate lockfile…
github-actions[bot] 4650bd9
fix(ci): pin bun version in trigger workflows and regenerate lockfile
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { auth } from '@/app/lib/auth'; | ||
| import { headers } from 'next/headers'; | ||
| import { redirect } from 'next/navigation'; | ||
|
|
||
| export default async function OrgLayout({ | ||
| children, | ||
| params, | ||
| }: { | ||
| children: React.ReactNode; | ||
| params: Promise<{ orgId: string }>; | ||
| }) { | ||
| const { orgId } = await params; | ||
| const requestHeaders = await headers(); | ||
|
|
||
| const session = await auth.api.getSession({ headers: requestHeaders }); | ||
|
|
||
| if (!session?.user) { | ||
| return redirect('/auth'); | ||
| } | ||
|
|
||
| // Sync activeOrganizationId if it doesn't match the URL's orgId. | ||
| // Without this, multi-org users get 403s because HybridAuthGuard | ||
| // resolves memberId from the session's activeOrganizationId, not the URL. | ||
| const currentActiveOrgId = session.session.activeOrganizationId; | ||
| if (!currentActiveOrgId || currentActiveOrgId !== orgId) { | ||
| await auth.api.setActiveOrganization({ | ||
| headers: requestHeaders, | ||
| body: { organizationId: orgId }, | ||
| }); | ||
| } | ||
|
|
||
| return <>{children}</>; | ||
| } | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silent failure of org switch renders children with wrong context
Medium Severity
The
setActiveOrganizationfunction silently swallows all errors in production, including network failures and non-OK API responses. This allows[orgId]/layout.tsxto render with a staleactiveOrganizationId, leading to 403s or incorrect data from API calls, and making these issues undiagnosable without production logging.Additional Locations (1)
apps/portal/src/app/lib/auth.ts#L138-L146Reviewed by Cursor Bugbot for commit da7d2d0. Configure here.