https://supabase.com/ logo
Join DiscordCommunities
Powered by
# help
  • f

    Flyken

    07/27/2021, 11:11 PM
    oh sorry i misread the supabase dashboard nvm
  • g

    grosse_tortue

    07/27/2021, 11:12 PM
    All good friend.
  • g

    grosse_tortue

    07/27/2021, 11:21 PM
    Looks like you can provide your own JWT during the creation of the Supabase client. Will have to experiment how I can consume and verify it from a procedure/function though. https://github.com/supabase/supabase/discussions/417#discussioncomment-229555
  • f

    frubalu

    07/27/2021, 11:35 PM
    Anyone know why I'd be getting the error message "Confirmation Token not found" when attempting to click on the email verification link?
  • h

    hieu

    07/28/2021, 12:24 AM
    you will see that error on second and subsequent clicks of the verification link.
  • f

    frubalu

    07/28/2021, 12:25 AM
    That's strange, because i'm getting this on the first initial click of the verification link
  • f

    frubalu

    07/28/2021, 12:25 AM
    Do you know where in the code this verification actually occurs? Might help me in debugging it
  • h

    hieu

    07/28/2021, 12:26 AM
    you can look at this PR https://github.com/supabase/gotrue/pull/91
  • f

    Flyken

    07/28/2021, 12:29 AM
    Copy code
    js
    {games.map(g => {
              console.log(g);
                  if(g.id !== curGame.id) {
                    return <Button onClick={() => handleSubscribe(curGame)}>Subscribe</Button>
                   }else{
                    return <Button danger onClick={() => handleUnsubscribe(curGame)}>Unsubscribe</Button>
                   }
              })}
    this is creating a button for every element inside
    games
    , why idea's? (my wanted behavior is a single button reflecting the above if statement)
  • f

    Flyken

    07/28/2021, 12:29 AM
    uhm
  • f

    Flyken

    07/28/2021, 12:29 AM
    mods?
  • f

    Flyken

    07/28/2021, 12:29 AM
    i didn't send the same message again?
  • f

    frubalu

    07/28/2021, 12:30 AM
    Thank you!
  • p

    PaganMuffin

    07/28/2021, 12:44 AM
    Because you are iterate throught all elements inside games and it create games.length elements. Try use games.find() It's look like react so try something like this
    Copy code
    js
    as function 
    const SubsButton = () => {
        const f = games.find(g => g.id !== curGame.id)
        if (f === -1) {
            return (
            <Button danger onClick={() => handleUnsubscribe(curGame)}>Unsubscribe</Button>
    
            )
        } else {
                <Button onClick={() => handleSubscribe(curGame)}>Subscribe</Button>
        }
    }
    
    In render
    <SubsButton></SubsButton>
  • f

    Flyken

    07/28/2021, 12:45 AM
    @User let me try
  • f

    Flyken

    07/28/2021, 12:46 AM
    @User it just keeps the button as either sub or unsub
  • f

    Flyken

    07/28/2021, 12:46 AM
    but doesn't switch no matter if im looking at a subbed game or not
  • f

    Flyken

    07/28/2021, 12:49 AM
    this is undefined (the log)
  • p

    PaganMuffin

    07/28/2021, 12:50 AM
    och right. find is returning undefined instead -1 if not found if you change -1 to undefined it should work
  • f

    Flyken

    07/28/2021, 12:50 AM
    npe
  • f

    Flyken

    07/28/2021, 12:51 AM
    yea its doing weird things
  • f

    Flyken

    07/28/2021, 12:55 AM
    the find method isn't returning anyhting
  • p

    PaganMuffin

    07/28/2021, 12:55 AM
    even if curGame.id is in games?
  • f

    Flyken

    07/28/2021, 12:55 AM
    what?
  • f

    Flyken

    07/28/2021, 12:55 AM
    yea
  • f

    Flyken

    07/28/2021, 12:56 AM
    portal 2 is not subscribed
  • f

    Flyken

    07/28/2021, 12:56 AM
  • f

    Flyken

    07/28/2021, 12:56 AM
    its returning a single game
  • p

    PaganMuffin

    07/28/2021, 1:00 AM
    try this
    Copy code
    js
        const SubsButton = () => {
            const f = games.find(g => g.id === curGame.id)
            console.log(f)
            if (f) {
                return (
                <button danger onClick={() => handleUnsubscribe(curGame)}>Unsubscribe</button>
        
                )
            } else {
              return (
                <button onClick={() => handleSubscribe(curGame)}>Subscribe</button>
              )
            }
        }
  • f

    Flyken

    07/28/2021, 1:03 AM
    aaayyee that works
1...121314...316Latest