https://supabase.com/ logo
Join DiscordCommunities
Powered by
# javascript
  • s

    Scott P

    08/26/2021, 7:32 PM
    Another option is something like this:
    Copy code
    ts
    export interface ISupabaseDeepLink {
      access_token: string;
      expires_in: string;
      refresh_token: string;
      token_type: string;
      type: string;
    }
    
    function hashToObject(entries) {
      const result = {};
      for (const [key, value] of entries) {
        result[key] = value;
      }
      return result;
    }
    
    const params = new URLSearchParams(window.location.hash.replace("#", ""));
    const parsedParams: ISupabaseDeepLink = hashToObject(
      params
    ) as ISupabaseDeepLink;
    
    if (parsedParams.type === "recovery") {
      // password reset
    }
    
    if (parsedParams.type === "magiclink") {
      // Magic link login
    }
    
    if (parsedParams.type === "invite") {
      // User invited via API/Dashboard
    }
  • i

    inner programmer

    08/26/2021, 11:53 PM
    hey ya'll, i'm deploying a vercel app with supabase for the first time and i'm running into a 'supabaseKey is required' error ... does anyone have any fool proof steps to follow for deploying a supabase app with vercel? note: I added the supabase integration on vercel and linked successfully, the variables are stored in an env.local file, and then referenced in the env configuration in the next.config.js file, anything else to do there?
  • s

    stibbs

    08/27/2021, 12:06 AM
    @inner programmer you need to make the environment variables in Vercel
  • s

    stibbs

    08/27/2021, 12:07 AM
    Log into your project in Vercel, in settings you can create the environment variables and specify what environments they are relevant for
  • s

    stibbs

    08/27/2021, 12:08 AM
    Settings > Project Settings > Environment Variables
  • i

    inner programmer

    08/27/2021, 12:17 AM
    gotchya - looks like supabase beat me to it with the integration setup tho - still throwing an error
  • i

    inner programmer

    08/27/2021, 12:17 AM
    this is what my next.config.js vars look like edit: updated the anon key and everything works now, love how simple that was haha. thanks for the help ya'll
  • w

    wilfredinni

    08/27/2021, 9:45 PM
    Hi! How can I create a new element inside a table and associate it to the intermediate table? thanks!
  • w

    wilfredinni

    08/27/2021, 9:50 PM
    Copy code
    javascript
    {
              user: payload.user,
              movement_type: payload.movement_type,
              wallet: payload.wallet,
              movement_category: [1, 2]  //itermediate table,
              amount: payload.amount,
              description: payload.description,
              attached_file: payload.attached_file,
              importance: payload.importance,
              updated_at: payload.updated_at
    }
  • w

    wilfredinni

    08/27/2021, 11:51 PM
    I cant find any kind of information about this, I suppose I have to save everything manually?
  • w

    wilfredinni

    08/27/2021, 11:51 PM
    ...
  • s

    Steve

    08/27/2021, 11:54 PM
    Yes, for now you have to insert the intermediate table manually. Inserts return the data by default, so you can get the ids from there. Another option to do it all in one request would be creating a function and calling it with rpc: https://supabase.io/docs/reference/javascript/rpc
  • w

    wilfredinni

    08/27/2021, 11:59 PM
    ok, thank you
  • g

    Garrett Tolbert

    08/28/2021, 1:16 AM
    Just started using supabase and trying to get phone auth with twilio working. When i verify token with
    verifyOTP()
    , I get the following error:
    new row violates row-level security policy for table "profiles"
    Below are my policies, how can i fix this?
  • p

    ppikachu

    08/28/2021, 6:37 AM
    Anyone can tell me whats wrong with this query?
    Copy code
    let { data: user_presets, error } = await $supabase
        .from('user_presets')
        .select('preset_name, preset, id, visualsas(slug)')
        .filter('visualsas.slug', 'eq', 'pixi')
    The output, instead of filtering and returning the one with the blue arrow it's returning all rows...🤯
    s
    • 2
    • 2
  • d

    Dylon

    08/28/2021, 7:24 AM
    How do I get auth user in a backend app with a JWT that came from frontend app using
    supabase.auth.signIn()
    ?
  • l

    larryM

    08/28/2021, 1:47 PM
    has anyone refreshed a user session with refreshAccessToken over server successfully? Im running into an issue where a POST request from our mobile apps gets a
    Copy code
    {
      "code": 400,
      "msg": "Could not read refresh token grant params: EOF"
    }
  • j

    Jacob Unknown

    08/28/2021, 4:32 PM
    how does
    .update()
    actually work? I'm reading the documentation, but I can't understand how it's supposed to work.
  • s

    silentworks

    08/28/2021, 7:17 PM
    What part are you having issue with?
  • j

    Jacob Unknown

    08/28/2021, 7:19 PM
    I just didn't understand what the documentation was saying, I've got it working with upsert instead now.
    m
    • 2
    • 2
  • s

    Steve

    08/28/2021, 10:09 PM
    filter source table
  • r

    RichCorbs

    08/29/2021, 12:45 AM
    Has anyone seen a magic link not trigger the user being logged in fast enough (auth.user returns null) unless you wait a second or two? The redirect happens so fast that whatever is going on in the background in supabase hasn't finished by the time I'm querying for auth.user().
  • t

    tinjaw

    08/29/2021, 2:42 AM
    Hop over to #843999948717555735 There is a current service issue
  • b

    burggraf

    08/29/2021, 2:51 AM
    https://github.com/supabase/supabase/issues/2983
  • b

    Biondi Bagasta Wiko Putra

    08/29/2021, 2:55 AM
    #843999948717555735 Why i got this error while trying to signup using IONIC angular????
    Copy code
    ERROR Error: Uncaught (in promise): Object: {"message":"Error sending confirmation mail","status":500}
    supabase.service :
    Copy code
    ts
    async signUp(credentials: { email: string, password: string }) {
        return new Promise(async (resolve, reject) => {
          const { error, data } = await this.supabase.auth.signUp(credentials);
    
          if(error) {
            reject(error);
          } else {
            resolve(data);
          }
        })
      }
    loginPage.ts :
    Copy code
    ts
    signUp() {
        console.log(this.loginForm.getRawValue());
        this.supabaseAuthService.signUp(this.loginForm.getRawValue()).then(data => {
          console.log(data);
        })
      }
    my form value :
    Copy code
    Object { email: "admin@gmail.com", password: "admin123" }
    I'm just copying this code from my other project which is work, but why this code doesn't work on my new project......
  • b

    burggraf

    08/29/2021, 3:07 AM
    Supabase team is working on fixing this now.
  • b

    Biondi Bagasta Wiko Putra

    08/29/2021, 3:08 AM
    oh thank's for informing me, i though my code was wrong...... Hopefully it will be fixed soon
  • r

    RichCorbs

    08/29/2021, 3:08 AM
    In my instance the email was being sent and received. What I was seeing had to do with what happened after the magic link was clicked.
  • b

    burggraf

    08/29/2021, 3:09 AM
    @RichCorbs how long ago did you have this problem?
  • r

    RichCorbs

    08/29/2021, 3:10 AM
    2.5+ hours ago. I stopped looking at it for the day.
1...141516...81Latest