Login with Discord

  • stealfr-1198670539091365990

    SteaL

    1 year ago

    Hi, I'm trying to implement a login with discord option on supabase https://supabase.com/docs/guides/auth/social-login/auth-discord.

    I have some troubles to implement the login code in toddle :

    async function signInWithDiscord() {
    const { data, error } = await supabase.auth.signInWithOAuth({
    provider: 'discord',
    })
    }

    Did someone already did it ?
  • lucasg-1198672071773921301

    Lucas G

    1 year ago

    That snippet won't work, ou have to initiate a supabase client first
  • andreasmoller-1198672108847382619

    Andreas Møller

    1 year ago

    We use supabase auth, but not the js lib
  • lucasg-1198672167747989565

    Lucas G

    1 year ago

    I think you have to use https://<your-ref>.supabase.co/auth/v1/authorize?provider=discord
  • and provide a redirect_to url
  • So something like
  • https://<your-ref>.supabase.co/auth/v1/authorize?provider=google&redirect_to=https://<your-site>.com/welcome
  • stealfr-1198673528392781844

    SteaL

    1 year ago

    I will try
  • Thanks @Lucas G
  • Was considering using custom formulas too
  • sanedealer-1291435066073026662

    Edwin Paul

    6 months ago

    Hey Lucas, i cant get this to work. Please help!
  • sanedealer-1291436077898399764

    Edwin Paul

    6 months ago

    1291436077583958179-
  • sanedealer-1291436454232326289

    Edwin Paul

    6 months ago

    405 (Method Not Allowed)
    I'm getting this error
  • You follow those instructions except the JS client part
  • In toddle you use the URL mentioned above