supabase: MFA example is missing RLS policy for mfa_factors
Improve documentation
Link
https://supabase.com/docs/guides/auth/auth-mfa
Describe the problem
I tried to implement MFA and enforce only for users that have opted-in. But when I try to fetch now I get this error:
permission denied for table mfa_factors
I tried a couple combinations to make mfa_factors readable but I can’t get it to work.
Describe the improvement
It would be great to have also an example RLS policy for the mfa_factors to make them accessible only for the MFA check.
Additional context
Add any other context or screenshots that help clarify your question.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (6 by maintainers)
It’s still erroring! @Collin0810 's fix could be referenced in the docs.
Hi @KirioXX,
I encountered a similar issue and managed to resolve it by creating a separate
check_mfafunction set as aSECURITY DEFINER.This function enforces MFA when the user has at least one MFA factor verified:
Once created, you can implement the checks in your RLS policies as follows:
Hope this helps!