supabase auth with provider

  • absahni-1337900401693032458

    Abhishek Sahni (Abhi)

    1 month ago

    Hi,

    I am using Supbase as a db and the Authentication. For the Auth part I would like to use login with linkedin.

    I created a button and added an onclick event to link to https://<my_url>.supabase.co/auth/v1/authorize?provider=linkedin_oidc&redirect_to=https://<my_url>.supabase.co/auth/v1/callback. When I click on the button I am redirected to the linkedin login page and once I sign in an account is created in the users table in my supabase DB.

    Questions:
    1. Once the user successfully logins in with Supabase they are redirected to http://localhost:3000/#access_token=<XXXXXXX>. How do I bring the user back to the toddle app
    2. How do I extract the access_token from the call back url?
    3. Is adding this as an API the recommended approach? Based on the tutorials it is easier to extract the access token from the API response

    Thank you
    1
  • benjamin.h-1338014811899822131

    Ben H

    1 month ago

    Basically you need to make a toddle page that you redirect to that extracts the access token from the url and saves it as a cookie. Make sure you add your url to the permitted redirects list in Supabase.
    🙏1
  • I could show you a full example later (ie tomorrow)
  • benjamin.h-1338018711310958593

    Ben H

    1 month ago

    I prefer to open the login window in a popup so the user isn’t pulled from their original context
  • absahni-1338025087533711423

    Abhishek Sahni (Abhi)

    1 month ago

    You sir are amazing, thank you. I was missing the permitted redirects in Supabase.
  • absahni-1338025187345436683

    Abhishek Sahni (Abhi)

    1 month ago

    Intersting, I will read up about doing this, thank you again
  • benjamin.h-1338230025736028333

    Ben H

    1 month ago

  • absahni-1338239956807581726

    Abhishek Sahni (Abhi)

    1 month ago

    this is amazing, thank you
    👍1

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.