Next.js Authentication with Twitter & NextAuth.js

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 49

  • @colbyfayock
    @colbyfayock  2 місяці тому

    Learn how to build a full stack Next.js app in my upcoming course: colbyfayock.com/course

  • @JohnMustson
    @JohnMustson Рік тому +1

    You're the best teacher I've ever seen on Twitter

    • @colbyfayock
      @colbyfayock  Рік тому +1

      really appreciate that :)

    • @JohnMustson
      @JohnMustson Рік тому

      haha - man I meant to say UA-cam xD@@colbyfayock

  • @colbyfayock
    @colbyfayock  Рік тому

    Get fresh tutorials and other free content straight to your inbox! colbyfayock.com/news

  • @webophir
    @webophir 3 роки тому +2

    This is great! Short and straightforward! It would be great if you can make a video about "What's next after setting up NextAuth.js" like connecting database to get the user posts, for example. Most of the NextAuth.js tutorial videos don't cover what to do after basic auth setup.

    • @colbyfayock
      @colbyfayock  3 роки тому

      the database part isa good idea. i did recently put out a video about using the Twitter oauth tokens in a serverless function! ua-cam.com/video/5wjuar9AU-0/v-deo.html

  • @naveedausaf3332
    @naveedausaf3332 11 місяців тому

    terrific tutorial Colby, lot's of info, clearly presented, in a brilliantly short tutorial. Thank you!

  • @sleechigo3759
    @sleechigo3759 8 місяців тому

    Hi, please any idea why the auth page display dangerous site. Though ssl is installed on the site, every other page is fine, but the twitter authentication page displays unsecure connection to users. Please how to fix.

  • @frontendonly
    @frontendonly 2 роки тому

    thanks colby fayock,straight forward and amazing tutorial

  • @javidking63
    @javidking63 3 роки тому +1

    that was very easy ! you are my hero!

  • @SingleSeeker
    @SingleSeeker Рік тому

    have you ever thought about the refresh token ? I am working to it, it made me crazy.

  • @mohammedalkhalaf6374
    @mohammedalkhalaf6374 3 роки тому

    the best explanation ever. Thank you very much.

  • @pensums
    @pensums 3 роки тому

    I've been trying to get Firebase Auth working in my app. I want to provide an admin dashboard in my site so the administrator can set things in there. :D Your video is short and clear, as always. Keep up the good work, I love it! It is sure gonna help me understand how the puzzle is connected together.
    One thing was left unanswered and it's the Privacy Policy and the Terms of Service. Knowing nothing about those and how to protect myself, what would be the best course of action to fulfill those requirements?

    • @colbyfayock
      @colbyfayock  3 роки тому +1

      thank you! honestly i would recommend doing a little research on it from other sources, i dont want to provide recommendations as that starts to get into "legal advice" territory 😅and i really don't have a complete understanding of best practices anyways. you might be able to find some open source ones or generators

    • @pensums
      @pensums 3 роки тому

      @@colbyfayock hehe, I understand 😆 It is kinda tricky with legal protections 🙃

  • @venkatapenumatsa3959
    @venkatapenumatsa3959 3 роки тому

    Thanks Colby useful information. is it possible if we can combine magic links with Next Auth ?

    • @colbyfayock
      @colbyfayock  3 роки тому +1

      no problem! it looks like their "email" provider supports that: next-auth.js.org/providers/email

  • @cryptodev2615
    @cryptodev2615 3 роки тому

    I get an error in production when using Vercel. I have uploaded all my environmental variables to vercel, and I update the NEXTAUTH_URL="my production url" and my github providers URL and Callback URL. Any ideas?

    • @colbyfayock
      @colbyfayock  3 роки тому

      what error are you getting? were you able to see any logs in Vercel?

  • @mdridoy-ef2pw
    @mdridoy-ef2pw 3 роки тому

    great video man!
    Is there any way to extend the user object in the session?
    it only allows name, email and photo.

    • @colbyfayock
      @colbyfayock  3 роки тому

      Hey did you try to use the session callback? next-auth.js.org/configuration/options#callbacks

    • @jackn
      @jackn 2 роки тому

      @@colbyfayock The callback only seems to have the same information. Where does info like the user's twitter handle or their bio get stored?

    • @colbyfayock
      @colbyfayock  2 роки тому

      @@jackn im not sure that you would get the entire profile like that by default, i would look through the different objects passed in via jwt
      async jwt({ token, user, account, profile, isNewUser }) {
      otherwise yo ucould request that information from the twitter API directly

    • @jackn
      @jackn 2 роки тому

      @@colbyfayock profile has it, thanks!

  • @mustaneerhaider515
    @mustaneerhaider515 2 роки тому

    twitter rejected my request for elevated pack 2 times i described my use case to them that i wanna just add twitter login functionaality to my app and i want to use some user profile info such as username and profile image and they didn't approved it twice.

    • @colbyfayock
      @colbyfayock  2 роки тому

      sorry to hear, im not sure how that works

    • @mustaneerhaider515
      @mustaneerhaider515 2 роки тому

      @@colbyfayock can u tell me what to write so that i can get my application approved by twitter. It will help me a lot.

  • @xHeroinBoBx
    @xHeroinBoBx 3 роки тому

    thank you!

  • @ITRebels
    @ITRebels 6 місяців тому

    how to get twitter username ?

    • @colbyfayock
      @colbyfayock  5 місяців тому

      it's been a minute since i worked in this but id expect it to be either in the user or account object accessible through a callback: next-auth.js.org/configuration/callbacks

  • @rangabharath4253
    @rangabharath4253 3 роки тому

    awesome

  • @minus1903
    @minus1903 2 роки тому

    Idk why am i the only one getting errors :)

    • @colbyfayock
      @colbyfayock  2 роки тому +1

      where are you getting an error?

    • @minus1903
      @minus1903 2 роки тому

      @@colbyfayock on the authentication part, the error is like : missing oauth headers unable to retrieve user data. i'm getting an empty object

    • @colbyfayock
      @colbyfayock  2 роки тому +1

      @@minus1903 here's my code if you want to check out what im doing github.com/colbyfayock/my-auth-app
      if im not mistaken NextAuth might have updated how you pass in the NextAuth configuration or how you get the data from the callback arguments
      i would also poke through here and see if anyhting looks of next-auth.js.org/getting-started/example

    • @minus1903
      @minus1903 2 роки тому

      @@colbyfayock thanks man i will look it up
      Can you make an discord server so that we can reach out to you there ?

    • @colbyfayock
      @colbyfayock  2 роки тому +1

      @@minus1903 spacejelly.dev/discord :)