fix(org): require admin 2FA before org-wide enforcement#1682
fix(org): require admin 2FA before org-wide enforcement#1682
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96858a7707
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { error } = await supabase.functions.invoke('organization', { | ||
| method: 'PUT', | ||
| body: { |
There was a problem hiding this comment.
Use JWT-compatible endpoint for org 2FA toggle
This UI path now calls supabase.functions.invoke('organization', { method: 'PUT' ... }), but that endpoint is guarded by middlewareKey in supabase/functions/_backend/public/organization/index.ts (API-key auth), not JWT auth; dashboard sessions normally send a JWT and no capgkey, so the request is rejected as invalid_apikey before the 2FA prerequisite logic runs. In practice this makes organization 2FA enforcement changes fail for signed-in web users unless they manually provide an API key header.
Useful? React with 👍 / 👎.
|



Summary (AI generated)
Motivation (AI generated)
Allowing organization-wide 2FA enforcement without self-2FA can create inconsistent security policy application and potential admin misuse. This patch enforces hierarchical security by validating the actor's security posture before applying the org policy.
Business Impact (AI generated)
Test Plan (AI generated)
Generated with AI