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

    lazerrouge

    07/20/2022, 4:34 PM
    Thanks, this was helpful!
  • j

    Joshios

    07/20/2022, 6:00 PM
    My real-time broke all of a sudden and I’m not sure what happened
  • j

    Joshios

    07/20/2022, 6:01 PM
    All real-time tables are no longer detecting table updates
  • j

    Joshios

    07/20/2022, 6:01 PM
    The client is subscribing
  • s

    shini

    07/20/2022, 6:33 PM
    this is happening to me too. not just today but yesterday too
  • s

    shini

    07/20/2022, 6:37 PM
    re-opened the issue: https://github.com/supabase/supabase/issues/7771
  • s

    shini

    07/20/2022, 6:40 PM
    are you using nextjs by any chance @Joshios
  • j

    Joshios

    07/20/2022, 6:42 PM
    Yea
  • j

    Joshios

    07/20/2022, 6:42 PM
    I changed nothing at all
  • j

    Joshios

    07/20/2022, 6:42 PM
    And it’s broken on a prod build too
  • g

    garyaustin

    07/20/2022, 6:55 PM
    @shini @Joshios Are there any rows in the realtime table subscriptions (realtime schema)? I just turned on a test of realtime, not getting responses, no RLS, pure javascript. I have no entries in the table, which is not good.
  • j

    Joshios

    07/20/2022, 7:09 PM
    I sent an email to support and they fixed it
  • s

    shini

    07/20/2022, 7:14 PM
    no i dont see anything
  • g

    garyaustin

    07/20/2022, 7:25 PM
    I've reported it to support for my two instances and also noted users are reporting issues here. Seems strange if it was a major outage so few reports though... both of mine are on US-east
  • s

    shini

    07/20/2022, 7:26 PM
    i'm on eu-west-2
  • s

    shini

    07/20/2022, 7:28 PM
    i think it might be a VPN issue
  • s

    shini

    07/20/2022, 7:29 PM
    toggled the vpn on and off when inserting id 5
  • s

    shini

    07/20/2022, 7:30 PM
    that might explain the lack of reports
  • g

    garyaustin

    07/20/2022, 7:36 PM
    You had a vpn on? I don't have one on.
  • r

    rinorzk

    07/20/2022, 7:41 PM
    guys what is the difference between anon and authenticated role? where should I use which?
    g
    • 2
    • 15
  • s

    shini

    07/20/2022, 7:41 PM
    hmm, actually perhaps not sure.
  • g

    garyaustin

    07/20/2022, 7:56 PM
    anon, authenticated roles
  • y

    Yeehawlerz101

    07/20/2022, 11:53 PM
    I'm most definetly missing something but I've been trying to look for an example where someone has gotten
    await supabase.auth.api.inviteUserByEmail(email)
    to work with the
    service_role
    . But I have no idea where the service role goes or how to make it actually work properly so for future seekers of this PostHog Actually has some docs on how it works (in thread)
    s
    • 2
    • 2
  • k

    kr4b5

    07/21/2022, 3:40 PM
    Hi community! I'm currently building an Angular App and would like to add a Supabase Login. Just for context: The backend part of my application is as good as done. The backend expects a Supabase JWT in the auth header, which it then checks by using the secret provided in the supabase dashboard. Back to my problem. I've followed the online tutorials for adding supabase to an Angular application but can't seem to get it right. I'll post my AuthService code below. Can anyone help me find what's wrong? The supabase auth logs don't event show a login attempt, which is why im wondering if the supabase-js call even works properly...
  • k

    kr4b5

    07/21/2022, 3:40 PM
    Copy code
    import { Injectable } from '@angular/core';
    import {AuthChangeEvent, createClient, Session, SupabaseClient} from '@supabase/supabase-js';
    import { environment } from 'src/environments/environment';
    export interface IUser {
      username: string;
      email: string;
    }
    @Injectable({
      providedIn: 'root'
    })
    export class AuthService {
      private supabase: SupabaseClient;
    
      constructor() {
        this.supabase = createClient(environment.supabaseUrl, environment.supabaseKey);
      }
      get user() {
        return this.supabase.auth.user();
      }
    
      get session() {
        return this.supabase.auth.session();
      }
      get profile() {
        return this.supabase
          .from('profiles')
          .select(`username, email`)
          .eq('id', this.user?.id)
          .single();
      }
      authChanges(callback: (event: AuthChangeEvent, session: Session | null) => void) {
        return this.supabase.auth.onAuthStateChange(callback);
      }
      signIn(email: string, password: string) {
        return this.supabase.auth.signIn({ "email": email, "password": password });
      }
      signUp(email: string, password: string) {
        return this.supabase.auth.signUp({ email, password })
      }
      signOut() {
        return this.supabase.auth.signOut();
      }
      updateProfile(profile: IUser) {
        const update = {
          ...profile,
          id: this.user?.id,
          updated_at: new Date()
        }
        return this.supabase.from('profiles').upsert(update, {
          returning: 'minimal',
        });
      }
      downLoadImage(path: string) {
        return this.supabase.storage.from('avatars').download(path);
      }
      uploadAvatar(filePath: string, file: File) {
        return this.supabase.storage
          .from('avatars')
          .upload(filePath, file);
      }
    }
  • k

    kr4b5

    07/21/2022, 3:41 PM
    The signIn call come from login.component.ts and is handled as follows:
    Copy code
    handleLogin(mail: string, pw: string) {
        this.loading = true;
        this.supabase.signIn(mail, pw).then((res) => {
          console.log(res);
          console.log(this.supabase.user)
          alert('Logged in!');
        }).catch((err) => {
          console.log(err)
          this.loading = false;
        });
      }
    Console output:
    Copy code
    Object { data: null, user: null, session: null, error: {…} }
    null
  • k

    Kelaos

    07/21/2022, 5:05 PM
    For the Edge Functions how do you set the severity of your logs? I notice
    console.log
    defaults to INFO so how would you get a
    LOG
    severity for instance? EDIT: Tried using Deno's stdlib log (new to Deno) but that still shows as INFO despite doing
    log.error()
  • x

    xavier

    07/21/2022, 6:46 PM
    Hey there, I have a question regarding the
    upsert
    function. On signin/signup on my app I want to store a few personal data of my user, i do it with
    Copy code
    const { data: user, error } = await supabase.from('user_data').upsert({
            first_name: data.firstName.localized.en_US,
            last_name: data.localizedLastName,
            profile_pic: avatarURL,
            access_token: token
        });
    I used an
    upsert
    to insert a new row if the user doesn't exist, update a row otherwise. But it doesn't works, the current code add a new row on each new signin. What am I missing?
  • g

    garyaustin

    07/21/2022, 6:48 PM
    You need to provide a primary key. Otherwise how will it know which record to replace?
  • x

    xavier

    07/21/2022, 6:49 PM
    That's what I was guessing, but it's not super clear in the doc. How do I do that?
    g
    • 2
    • 21
1...737475...81Latest