https://supabase.com/ logo
Join Discord
Powered by
# off-topic
  • s

    sixfour

    06/12/2022, 10:46 PM
    Hi all, is there a recommended pattern for creating users locally? In my production env, I have users sign in with email or Google?
    s
    • 2
    • 2
  • s

    silentworks

    06/12/2022, 11:02 PM
    Hi all is there a recommended pattern
  • g

    goinglive-in-321

    06/12/2022, 11:06 PM
    Hi, I used supabase for authentication for my react native app but it redirect me to my website and then a user name is create in my data and the password field either becomes empty or some randomly generated password. Is there something that I'm missing that is needed for the user to be redirected back to the app when they are authenticated? in facebook my app is in production mode and for google right now it has been submitted to get approved to be accepted into production.
  • r

    renaldodev

    06/13/2022, 4:09 PM
    Hi there, can you suggest me some resource about transaction with supabase? I can't find a content with a clear approach
  • h

    Haus Of Alejandro

    06/13/2022, 5:25 PM
    @renaldodev you can create a function and that will behave as a transaction basically, since it will rollback any actions in between the BEGIN and END; if an exception is raised.
  • j

    Jingly

    06/14/2022, 1:03 AM
    Are there any guidelines or requirements for submitting pull requests?
  • r

    Rahul VR

    06/14/2022, 9:34 AM
    hi, am trying to use supabase google auth with visual studio code, i need to pass a state with redirect to and get it once authentication is done. Unfortunately, after google auth any custom params given is gone.
  • j

    jaitaiwan

    06/14/2022, 9:49 AM
    Hey @Rahul VR you should be able to encode query params into the redirect url when performing the auth
  • r

    Rahul VR

    06/14/2022, 9:53 AM
    thanks Jai for response , i tried that too https://------.supabase.co/auth/v1/authorize?provider%3Dgoogle%26redirect_to%3Dvscode%3A%2F%2Feliostruyf.vscode-auth0-authprovider%3Fstate%253D%257B%2522a%2522%253A%2522y%2522%252C%2522b%2522%253A%2522z%2522%257D
  • r

    Rahul VR

    06/14/2022, 9:53 AM
    apparently, the response redirect doesn't have the state param
  • r

    Rahul VR

    06/14/2022, 9:54 AM
    eturn vscode://eliostruyf.vscode-auth0-authprovider#access_token%3DeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjU1MjAzOTM5LCJzdWIiOiI4MjQ0ODVmMS00OWI5LTQwMGMtYjEzZS1hZTJjNGZjMGJi....%26provider_token%3Dya29.a0ARrdaM_xy7sffffkcx3s00NxFnEo4-tZz0cJhqApiwRkeDQ1QffLH6-12jYSfcaMMmJil_g6hF3of5RuIpkdsZD9wlUf5i2ObmPC0TvwLxzuto7OTxIzc1w7eCKMphUFrk5HSlLlk1RetaKzAM3TR_DSffdSksug%26refresh_token%3DhC1nJ_vEaAPfsdfsdfsdfIxIYRFUCY-g%26token_type%3Dbearer
  • j

    jaitaiwan

    06/14/2022, 9:58 AM
    @Rahul VR how are you calling the auth endpoint? Are you using supabasejs?
  • j

    jaitaiwan

    06/14/2022, 9:58 AM
    Just wondering what params you’re using if you are…
  • r

    Rahul VR

    06/14/2022, 9:58 AM
    nope , am using api directly
  • j

    jaitaiwan

    06/14/2022, 9:58 AM
    Ok one sec
  • r

    Rahul VR

    06/14/2022, 9:59 AM
    Copy code
    const searchParams = new URLSearchParams([
            ['redirect_to', this.redirectUri]
          ]);
    https://ddfdf.supabase.co/auth/v1/authorize?provider=google&${searchParams.toString()}
    where redirect_to will be
    vscode://eliostruyf.vscode-auth0-authprovider
  • j

    jaitaiwan

    06/14/2022, 10:06 AM
    Is it not redirecting to the vscode url? If it’s that there’s no params on the redirect url then id say that’s expected because you haven’t passed any though with the redirect_to param. I’d expect it to be something like vscode://url?myparam=foo
  • r

    Rahul VR

    06/14/2022, 10:07 AM
    oh i did actually , tried with vscode://url?myparam=foo but once redirect it becomes vscode://url#access_token also tried with state=sdfsdf params too
  • r

    Rahul VR

    06/14/2022, 10:08 AM
    any param in the request or the redirect_to is getting replaced
  • r

    Rahul VR

    06/14/2022, 10:12 AM
    supabase is generating a state for google auth with following `
  • r

    Rahul VR

    06/14/2022, 10:12 AM
    Copy code
    {
      "exp": 1655201754,
      "site_url": "vscode://eliostruyf.vscode-auth0-authprovider",
      "id": "00000000-0000-0000-0000-000000000000",
      "netlify_id": "",
      "function_hooks": null,
      "provider": "google",
      "referrer": "vscode://eliostruyf.vscode-auth0-authprovider?statedfsdfs=4434"
    }
  • r

    Rahul VR

    06/14/2022, 10:13 AM
    where my state data (statedfsdfs) is missing
  • j

    jaitaiwan

    06/14/2022, 10:14 AM
    Is that state data url encoded?
  • r

    Rahul VR

    06/14/2022, 10:19 AM
    https://xvnvyntlneifzyrjuijv.supabase.co/auth/v1/authorize?provider%3Dgoogle%26redirect_to%3Dvscode%3A%2F%2Feliostruyf.vscode-auth0-authprovider%3Fstate%3D%7B%22a%22%3A%22y%22%2C%22b%22%3A%22z%22%7D
  • j

    jaitaiwan

    06/14/2022, 10:19 AM
    Checkin
  • r

    Rahul VR

    06/14/2022, 10:20 AM
    thanks jai , just sharing some debug things https://xvnvyntlneifzyrjuijv.supabase.co/auth/v1/authorize?provider=google&redirect_to=vscode://eliostruyf.vscode-auth0-authprovider?state={"a":"y","b":"z"}
  • j

    jaitaiwan

    06/14/2022, 10:21 AM
    For google (and auth0 and likely other providers too...) state is usually a base64 encoded string representation of a json object
  • j

    jaitaiwan

    06/14/2022, 10:24 AM
    So you should have something like: 1. Serialise my object as json 2. Encode as base64 3. Pass state as a query param to the /authorize endpoint
  • j

    jaitaiwan

    06/14/2022, 10:25 AM
    #3 might not be correct and you might have to encode it as a query param of the redirect_to param but I doubt it @Rahul VR see above
  • d

    DH

    06/14/2022, 10:26 AM
    Hi all, I've set up a new supabase project & I'm trying to invite users via the dashboard. I've tried multiple domains but I only seem to receive an invite to an @hotmail.com address, gmail doesn't receive anything. Is anyone else having problems?
1...232233234...392Latest