Skip to content
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

Supabase policy auth with Fultterflow #1712

Closed
3 tasks done
sergedahdouh opened this issue Oct 26, 2023 · 7 comments
Closed
3 tasks done

Supabase policy auth with Fultterflow #1712

sergedahdouh opened this issue Oct 26, 2023 · 7 comments

Comments

@sergedahdouh
Copy link

Has your issue been reported?

  • I have searched the existing issues and confirm it has not been reported.
  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

I am trying to RLS policy in Supabase which is policy ((auth.jwt() ->> 'sub'::text) = user_id) but in return i get an error 401 unauthorized, when i remove the policy is work perfect

Expected Behavior

((auth.jwt() ->> 'sub'::text) = user_id) this policy should allow auth user who has the id to delete update his own row

Steps to Reproduce

  1. create a new project
  2. create a new db in supabase
  3. confirm your steup in ff for supabase
  4. enable rls
  5. add new policy
  6. policy should be all and ((auth.jwt() ->> 'sub'::text) = user_id
  7. create a new account user
  8. check your supabase
Screenshot 2023-10-26 at 18 41 07 Screenshot 2023-10-26 at 18 41 12 Screenshot 2023-10-26 at 19 05 33

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

https://app.flutterflow.io/project/testauction-26ii4i?tab=uiBuilder&page=Auth4

Context

you cannot use supabase policy

Visual documentation

you cant use supabase policy
Screenshot_2023-10-26_at_18 47 28

Additional Info

No response

Environment

- FlutterFlow version: 3.13.7
- Platform: web test mode 
- Browser name and version: chrome 
- Operating system and version affected: mac os
@sergedahdouh sergedahdouh added the status: needs triage A potential issue that has not been confirmed as a bug. label Oct 26, 2023
@casey1011
Copy link

I think this is an issue from your supabase, try using, ' auth.uid() = user_id '

@sergedahdouh
Copy link
Author

sergedahdouh commented Oct 26, 2023

I think this is an issue from your supabase, Try 'using'auth.uid() = user_id.

Hello, I tried, but it did not work. Have you tired of it? by the way, my user_id is text

Screenshot 2023-10-26 at 22 05 00

@casey1011
Copy link

hmm, using jwt.io, I see your sub is 123456 is that what you had it as? Are you logged in when you try to make the request?
image

@sergedahdouh
Copy link
Author

sergedahdouh commented Oct 26, 2023

no this when i create the account, I need to insert a row. i am not logged in; I am in process of creating the account
Screenshot 2023-10-26 at 22 23 40

Screenshot 2023-10-26 at 22 23 46

@sergedahdouh
Copy link
Author

sergedahdouh commented Oct 26, 2023

Screenshot 2023-10-26 at 22 29 25 Screenshot 2023-10-26 at 22 29 18 Screenshot 2023-10-26 at 22 30 22 Screenshot 2023-10-26 at 22 30 54

Copy link

github-actions bot commented Nov 3, 2023

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

@katherineqian
Copy link
Contributor

Hi @sergedahdouh, thank you for submitting this issue. This issue tracker is intended for general bugs that are applicable to all users. It looks like this error may be specific to your project, so this is classified as a support request and will be closed. Please use chat support or contact support [at] flutterflow.io where they can be more helpful in allowing you diagnose the cause of your issue.

@katherineqian katherineqian added closed: support request and removed status: needs triage A potential issue that has not been confirmed as a bug. labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants