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

    silentworks

    11/10/2021, 10:34 AM
    @User have you gotten all your password reset stuff working now? otherwise I can cook up an example for you
  • u

    user

    11/10/2021, 11:30 AM
    hey team, quite excited about supabase, where can i view the code for the backend though? the github seems to only have client side code only
  • u

    user

    11/10/2021, 11:31 AM
    we'd like to run the self hosted version but can't seem to find the source code for what runs in the docker image
  • r

    rc9999999

    11/10/2021, 11:51 AM
    Is there a lot of bugs with Supabase?
    s
    • 2
    • 15
  • r

    rc9999999

    11/10/2021, 11:51 AM
    I'm experiencing things, where they work one moment, then I refresh and they don't work
  • r

    rc9999999

    11/10/2021, 11:53 AM
    Copy code
    const { user_id } = router.query;
    
      useEffect(() => {
        fetchIt();
      }, []);
    
      async function fetchIt() {
        try {
          setLoading(true);
          const { data, error } = await supabase
            .from("posts")
            .select("title, created_by")
            .match({ created_by: user_id });
          setPosts(data);
          console.log({ posts: data });
          if (error) throw error;
        } catch (error) {
          console.log(error);
        } finally {
          setLoading(false);
        }
      }
  • m

    magicbyt3

    11/10/2021, 12:17 PM
    Hi all, I have some issues with getting relations to work. I have multiple references set to my profiles table. However, this select is returning an error.
    Copy code
    js
    const { data, error, status } = await supabase
            .from('rooms')
            .select('*, owner:profiles(nickname), opponent:profiles(nickname)');
        
    hint    "By following the 'details' key, disambiguate the request by changing the url to /origin?select=relationship(*) or /origin?select=target!relationship(*)"
    message    "More than one relationship was found for rooms and profiles"
    details    [ {…}, {…} ]
    0    Object { origin: "public.rooms", relationship: "rooms_opponent_fkey[opponent][id]", cardinality: "m2o", … }
    origin    "public.rooms"
    relationship    "rooms_opponent_fkey[opponent][id]"
    cardinality    "m2o"
    target    "public.profiles"
    1    Object { origin: "public.rooms", relationship: "fk_profiles_rooms_opp[opponent][id]", cardinality: "m2o", … }
    origin    "public.rooms"
    relationship    "fk_profiles_rooms_opp[opponent][id]"
    cardinality    "m2o"
    target    "public.profiles"
    How can I disambiguate these?
    s
    • 2
    • 8
  • s

    silentworks

    11/10/2021, 12:56 PM
    Supabase issues
  • m

    MrPoule

    11/10/2021, 1:46 PM
    Hey Guys, I've been meddling with authentication (simple email, password one). I'm currently looking into supporting authentication in a project where I want to allow user with JS disabled on the client side to still use my app (based on SSR, ... and particularly here SvelteKit). So I can't
    supabase.auth.signIn
    on the client side and I'm doing this in an API endpoint receiving the user email and password. And if authentication is successful I would like to set the authentication cookie in the response in order to allow authentication of future requests server side (based on setAuth). I currently have found a way to do all this, but my sign-in endpoint feels very clunky (calling setAuthCookie with a modified request body). Here is what I have, do you see anyway to do the same differently or is this the best that can be done?
    Copy code
    javascript
    export const post = async (request, response) => {
        const { session, error } = await supabase.auth.signIn({
            email: request.body.get('email'),
            password: request.body.get('password'),
        });
        if (!error) {
            request.body = {
                event: 'SIGNED_IN',
                session: session,
            };
            supabase.auth.api.setAuthCookie(request, response);
            response.redirect(302, '/')
            return response;
        }
        return {
            headers: { Location: `/signin?error=${encodeURIComponent(error.message)}` },
            status: 302,
        };
    };
    Thanks in advance, I just love supabase!
  • j

    jon.m

    11/10/2021, 2:47 PM
    I did, but I don’t know if I did it how it was intended!
  • s

    silentworks

    11/10/2021, 2:48 PM
    if it's working, then yes. 😁
  • j

    jon.m

    11/10/2021, 3:53 PM
    @User , so the reset password link signed in the user. Then i was able to grab the type of auth state change from the event, which said it was reset password, so I redirected to the form. Then here's where I'm not sure I did the right thing. Instead of using the reset password example that requires the access token, I used the auth.update user method, which didn't require the token. Same result.
    s
    • 2
    • 3
  • y

    YelloJello

    11/10/2021, 4:17 PM
    This isn't documented in the supabase docs, you'd have to provide an additional hint so that postgrest understands what to do. Check the docs here: https://postgrest.org/en/v8.0/api.html#hint-disambiguation
  • f

    francisco.ew

    11/10/2021, 5:16 PM
    Hello Supabase team, Is there any way to show our domain in the API URL? Instead of the long URL of Supabase. Thank you!
    s
    s
    e
    • 4
    • 3
  • s

    silentworks

    11/10/2021, 5:37 PM
    Reset Password
  • s

    silentworks

    11/10/2021, 5:39 PM
    Showing your own domain in the API URL
  • s

    Steve

    11/10/2021, 6:29 PM
    disambiguate rooms and profiles
  • k

    Kevin21

    11/10/2021, 8:15 PM
    Hello everyone, i'm building an app with NextJs and Supabase and I was wondering if there is any possibility to use the .ilike instruction inside a .contains instrucion, because i'm using a searchbar with some Tags to filter, and I want to show the correct results even if the user is misspelling something or is not that accurate. Thanks for your time!
  • j

    jon

    11/10/2021, 8:23 PM
    queries for anyone else down right now?
  • y

    YelloJello

    11/12/2021, 9:36 AM
    under what conditions do real-time subscriptions go into "RETRYING_AFTER_TIMEOUT"? Does this have something to do with how stable the user's network is? how do you respond to this event? Do you recreate the subscription? Because it seems like the subscription just dies after a while, doesn't bounce back or stream some other event
  • m

    MrPoule

    11/12/2021, 11:50 AM
    Nobody? 😦
  • a

    askrodney

    11/12/2021, 2:13 PM
    HI I'm trying to work out refresh tokens...
  • a

    askrodney

    11/12/2021, 2:13 PM
    I have an app with SvelteKit front end and Rust Cloudflare Worker backend
  • a

    askrodney

    11/12/2021, 2:14 PM
    I can successfully log in on client with GitHub
  • a

    askrodney

    11/12/2021, 2:14 PM
    I pass the GutHub client generated refresh token to the worker
  • a

    askrodney

    11/12/2021, 2:15 PM
    On the worker I request an access token with REST from {SB_URL}/auth/v1/token?grant_type=refresh_token (using client's refresh token as input)
  • a

    askrodney

    11/12/2021, 2:15 PM
    I get back an access token
  • a

    askrodney

    11/12/2021, 2:16 PM
    When I try to use that token to create a DB row with postgrest-rs I get "Invalid authentication credentials" response
  • a

    askrodney

    11/12/2021, 2:16 PM
    If I use my anon key instead I have no issues...
  • a

    askrodney

    11/12/2021, 2:16 PM
    Should I be able to use the access token from a refresh to work on DB as a user? I want to get RLS benefits
1...129130131...316Latest