https://supabase.com/ logo
Join Discord
Powered by
# help
  • g

    garyaustin

    03/03/2022, 12:13 AM
    That would be a useful feature, but no not possible. You would need to set up a fake uuid, email and role to test out with just the 3 Supabase functions, but you could actually have your own functions looking at headers, or other jwt info also so would get complicated. Still would be helpful though. You might propose it in ideas or github. I've seen some use the sql window, setting the jwt claims and role to run tests, but it was pretty messy. If you search on test rls in the top right search bar you can find some info on that approach.
  • d

    DanMossa

    03/03/2022, 1:08 AM
    Unsure what I'm doing wrong. I successfully sign a user in via
    signInWithEmail
    . I then try getting the
    user()
    and it's null. Does that make sense or should successfully signing in auto set the user?
  • g

    garyaustin

    03/03/2022, 1:17 AM
    Can you clarify what signInWithEmail is.
  • d

    DanMossa

    03/03/2022, 1:17 AM
    oops. I was using api.signUpWithEmail instead of .signIn. Sorry it's for Flutter
  • d

    DanMossa

    03/03/2022, 1:19 AM
    I feel like some of these methods in Flutter should be private lol
  • g

    garyaustin

    03/03/2022, 1:24 AM
    Can't help with flutter/dart you might ask in the flutter tab or the github for that if really stumped. Or just make sure to flag as flutter to get someone's attention in the "normal" threads here.
  • s

    santiarr

    03/03/2022, 4:00 AM
    why is postgres 12 unsupported in the cli now?
  • r

    ramoncarden

    03/03/2022, 4:08 AM
    Hello can someone tell me if a server restart is necessary when you create a new table in the GUI? I created a channels table that Im trying to access in this React project with the code below, but i keep getting back an empty array. Not quite sure what Im doing wrong here.
    Copy code
    js
    const Rooms = () => {
      const [channel, setChannel] = useState([]);
    
      const gatherAllChatRooms = async () => {
        let { data, error } = await supabase.from('channels').select('*');
    
        if (error) {
          console.log(error);
        }
    
        if (data) {
          setChannel(data);
          console.log(data);
        }
      };
    
      useEffect(() => {
        gatherAllChatRooms();
      }, []);
    g
    • 2
    • 5
  • r

    ramoncarden

    03/03/2022, 4:08 AM
    Any help is appreciated
  • t

    tirmes

    03/03/2022, 4:25 AM
    Hey, I'm getting Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://url.supabase.co/auth/v1/magiclink. (Reason: CORS request did not succeed). Status code: (null).
  • t

    tirmes

    03/03/2022, 7:00 AM
    wait it works now idk y
  • k

    KrisGunnars

    03/03/2022, 8:45 AM
    I'm getting this too now
  • k

    KrisGunnars

    03/03/2022, 8:45 AM
    Access to XMLHttpRequest at 'https://urfnzpbsaeuvfchdfjgz.supabase.co/auth/v1/magiclink' from origin 'https://stockanalysis.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • m

    Maus

    03/03/2022, 8:51 AM
    I created an identity column through the supabase dashboard, but now I'm having trouble inserting rows through the sql editor. When opening the column details I can see 'is identity' is checked, and when inserting a row through postgrest (via supabase-js) the identity column works. But that same insert statement directly through the sql editor fails (there's an insert trigger on this table insert which depends on the generated sequential id), and what's strange to me is that the sequence is not shown in the
    information_schema.sequences
    schema. Anybody got any ideas? Column definition:
    Copy code
    SELECT 
       table_name, 
       column_name, 
       data_type 
    FROM 
       information_schema.columns
    WHERE 
       table_name = 'booking' AND column_name = 'sequential_id';
    
    >
    | table_catalog | table_schema | table_name | column_name   | column_default | is_nullable | data_type | is_identity | identity_generation | identity_cycle | is_generated | generation_expression |
    | ------------- | ------------ | ---------- | ------------- | -------------- | ----------- | --------- | ----------- | ------------------- | -------------- | ------------ | --------------------- |
    | postgres      | public       | booking    | sequential_id |                | NO          | integer   | YES         | ALWAYS              | NO             | NEVER        |                       |
    `information_schema.sequences`:
    Copy code
    SELECT * FROM information_schema.sequences WHERE sequence_schema = 'public';
    > Success. No rows returned
    Copy code
    SELECT currval(pg_get_serial_sequence('booking','sequential_id'));
    > currval of sequence "Booking_sequential_id_seq" is not yet defined in this session
    s
    • 2
    • 3
  • a

    and3rsonsousa

    03/03/2022, 12:45 PM
    I got an issue. In order to make supabase work on #Cloudflare #pages I had to patch the package.json from @User/supabase-js. The issue is: patch-package doesn’t create a patch for package.json and the patch can’t be applied on production. Is there a way to workaround this thing?
  • a

    and3rsonsousa

    03/03/2022, 2:35 PM
    Just found a solution. To whom it may concern: npx patch-package “name-of-the-package” —exclude “nothing”
  • k

    Kazuto

    03/03/2022, 2:38 PM
    What do I need to enter to get the email of the user in a relationship? Tried
    .select('*, user:users(email)')
    and
    .select('*, user:auth(email)')
    already.
    user_id uuid references auth.users(id) NOT NULL
    g
    • 2
    • 1
  • x

    xavier

    03/03/2022, 3:07 PM
    Hey there, I have some issues to auth with Twitter. I put my supabase url as callback on Twitter and just follow the tutorial but when I try to login ( with a button) it says: > No routes matches the url And it redirect to the base supa url, not the callback one.... Any idea of what I missed?
  • a

    Adi

    03/03/2022, 3:49 PM
    Anyone here used supabase with react for implementing private and public route? I am using exact same code from here https://ruanmartinelli.com/posts/supabase-authentication-react but problem is when user sign up happens then user should be navigated to login page but instead user session is generated and it gets automatically logged in. I don't want user to be able to view private routes if sign up is success only show private route if login is success. How can I do that?
    s
    t
    • 3
    • 13
  • g

    garyaustin

    03/03/2022, 3:54 PM
    relationship using auth
  • t

    thewebbeckons

    03/03/2022, 4:09 PM
    Navigation Guard - Auth for SIGNUP
  • t

    Tomasz Szczuciński

    03/03/2022, 5:31 PM
    Hello, is there a possibility to validate a data in rls policy on insert or update? For example I would like to restrict string length in post title. I can't find any information if it's possible using policies only. I know it can be done with rpc.
  • s

    Scott P

    03/03/2022, 5:38 PM
    Something like this might work. Any other checks could go after this line:
    IF (LENGTH(new.post_title) > 128) THEN RETURN FALSE;
    You can use postgres functions as RLS policies if necessary, and sometimes it's easier to manage the logic this way than cramming everything into the policy definition
  • g

    garyaustin

    03/03/2022, 5:47 PM
    You might also want to consider whether a check constraint might be a better approach for that type of thing. https://www.postgresqltutorial.com/postgresql-check-constraint/
  • t

    Tomasz Szczuciński

    03/03/2022, 5:52 PM
    @User@User Thank You, check constraint looks nice, i'll definetly check both, at least now I know what to do 😄
  • m

    Machine

    03/03/2022, 6:38 PM
    Hello guys, I'm using a phone number to login I've two functions. everything is working fine except that after a successful login. there is no token stored in localStorage I've another app with (email & password) login and it's working fine any ideas?
  • a

    arne

    03/03/2022, 6:42 PM
    Has anyone else had the problem that you can only have 1 project in free tier? Even after logging out I can't create a second free project.
    s
    • 2
    • 1
  • a

    asleepingpanda

    03/03/2022, 7:31 PM
    Hey! I'm sorry if this is a dumb question, but I just installed the
    MODDATETIME
    and
    INSERT_USERNAME
    extensions, but I have NO idea how to use them. Am I missing something? Is there documentation anywhere?
    g
    y
    s
    • 4
    • 4
  • l

    lopezjurip

    03/03/2022, 7:46 PM
    Hello, how can I upgrade to Postgres 14?
  • g

    garyaustin

    03/03/2022, 8:02 PM
    You have to create a new instance and migrate your data, unless you are a paying customer then ask support if they can help. Most recent comment on in this thread: https://discord.com/channels/839993398554656828/945665057549844510/945667214718140436
1...236237238...316Latest