Full Course - How to set up Email Authentication + Google OAuth in Next.js 14

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 75

  • @BenedictSebastian-tt9vd
    @BenedictSebastian-tt9vd 14 часов назад

    I haven't touch Javascript land in months but I remember doing Auth in nextjs being a pain in the ass. Thank you good sir for your service.

  • @cb73
    @cb73 4 месяца назад +21

    You fought the enemy that is the Auth JS docs so we don’t have to- thank you for your service!

  • @ammarthemartian
    @ammarthemartian Месяц назад +5

    This is the best tutorial in 9 years of learning coding. The info behind the code, the video speed, the structure, EVERYTHING IS PERFECT! Your 2 months of efforts to create this video really paid out!! 🎉❤

  • @oliver-lister
    @oliver-lister 7 дней назад

    Great explanation Jackson, you were a lifesaver for implementing this. Only suggestion is to use a library like ZSA to create procedures to avoid repeating the session calls and sanitising uuid in your server actions. It also uses Zod to validate inputs! Keep making videos.

  • @sq_int
    @sq_int 19 дней назад

    This was the first guide I've found that actually detailed everything clear enough so that I could get setup. Outstanding job and big thank you.

  • @victormayowa7989
    @victormayowa7989 4 месяца назад +2

    This guy has a seamless style of explaining concept with great steeze

  • @abidsalahi4989
    @abidsalahi4989 3 месяца назад +2

    If i'm not wrong, 'use server' is generally used for server actions which always initiate a POST request and Nextjs recommends using them for mutating data and NOT fetching data. If you want to ensure server side data fetching, you can do import 'server-only' at the top of the file and call server or DB to fetch data, otherwise it's not a great practice to fetch data within 'use server' files.

  • @kovs-game
    @kovs-game 4 дня назад

    This is a great video and tutorial for auth.js. many thanks for your efforts !

  • @serhiistanislav
    @serhiistanislav Месяц назад +1

    This is the best tutorial I've ever seen. Thank you

  • @shakil-the-coding-monster
    @shakil-the-coding-monster 11 дней назад

    One of the best tutorial i have ever found in youtube! kudos!!!

  • @marcchriqui556
    @marcchriqui556 3 месяца назад +2

    More Next.js/PostgreSQL videos like this one please! Great tutorial!

  • @Racine14
    @Racine14 Месяц назад +2

    Congrats... I am your follower now!

  • @ZorpX9
    @ZorpX9 28 дней назад

    dont know how much effort you have spend for this video, but this was really a good video. keep it up bro.

  • @ayarahemmanuel3326
    @ayarahemmanuel3326 2 месяца назад +2

    I should do an X appreciation tweet ...you're legendary I was stuck on auth for 6 months

    • @Jackson_Zheng
      @Jackson_Zheng  2 месяца назад +2

      @@ayarahemmanuel3326 That would be amazingly!

  • @goncalojbsousa
    @goncalojbsousa 4 месяца назад

    I just finished the tutorial. Very good content, its the best tutorial for auth.js out there. Thanks.

  • @JanNdungu
    @JanNdungu Месяц назад

    Here from Reddit! Awesome things in the works

  • @lnhv8593
    @lnhv8593 4 месяца назад +1

    bro this is awesome! please keep making more of this.

  • @codingwithlucy
    @codingwithlucy 3 месяца назад

    Thanks for breaking things down. You explain concepts so clearly :)

  • @steveahlstrom3542
    @steveahlstrom3542 4 месяца назад

    Would love to see a bit on deployment ... moving postgres to an external provider, etc.

  • @guanjunliu9544
    @guanjunliu9544 Месяц назад

    It's helpful. Thanks!

  • @Sidddev-v5i
    @Sidddev-v5i 3 месяца назад

    OUTSTANDING LECTURE THANKS PLESE MAKE MORE THIS TYPE OF LECTURE

  • @riceriot
    @riceriot 5 месяцев назад

    I was in the middle of implementing this and got this video notification 😂 . Thanks!

  • @trumppence3834
    @trumppence3834 4 месяца назад +2

    This is unreal! How did you learn all this stuff?

  • @omeryazar6068
    @omeryazar6068 4 месяца назад

    Very good content. Please keep uploading next.js tutorials like this

  • @broskisnajdy
    @broskisnajdy 2 месяца назад

    really nice tutorial, coded along and really enjoyed it! thanks

    • @broskisnajdy
      @broskisnajdy 2 месяца назад

      btw ending got me hahaha

  • @Magnificode
    @Magnificode 4 месяца назад

    This was a fantastic watch. Thank you!

  • @conradrusso
    @conradrusso 5 месяцев назад

    Thanks for the step by step tutorial. All worked flawlessly!

  • @abdulwasiuyusuf4110
    @abdulwasiuyusuf4110 Месяц назад

    Awesome 🔥🔥🔥🔥

  • @anhtruong6962
    @anhtruong6962 11 дней назад

    Great

  • @23AvpADR
    @23AvpADR 4 месяца назад +1

    Thanks. This is the best nextauth video I've ever seen. If anyone ask how to use nextauth just send this video instead of the doc. xD
    is there any specific reason why you use router.push instead next/link ?
    hope you make more video about next.js

    • @Jackson_Zheng
      @Jackson_Zheng  4 месяца назад

      @@23AvpADR Thank you so much! You have no idea how much that means to me!
      With regards to the router.push, it was just an arbitrary choice. I decided to go with that to keep the video consistent rather than switching between different methods of routing to minimise confusion for beginners. You can use whichever method you like.

  • @richardstuart2695
    @richardstuart2695 5 месяцев назад +1

    Wonderful content. Other content providers did not mention the necessary production settings which caused my production to fail yet dev to pass, was so frustrating. I note you verify authority to paths in the function, to see if signed in or not, or admin etc. Another solution is Middleware, any advantage of one approach over the other ?

    • @Jackson_Zheng
      @Jackson_Zheng  5 месяцев назад

      I wouldn't recommend using middleware. Next-Auth really isn't designed for it. I did try it, but I couldn't get it to work as the underlying library that next-auth uses to interact with the database uses an edge implementation which doesn't work with middleware.

  • @JoaoVictorGF1
    @JoaoVictorGF1 2 месяца назад

    I’m still learning this framework and had issues deploying the system to production. During the build process, I encountered some errors with variables that I managed to resolve, but once the build was successful, I faced problems related to the Secret. I’m more accustomed to React, where I could simply take the build folder and it would work. In this system, do I need to move these folders (.next, node_modules, package.json, and package-lock.json) to my production environment for testing?

  • @fadilnatakusumah195
    @fadilnatakusumah195 18 дней назад

    Have you tried to deploy it to production just to see if it's working or not? Because to me, when I deployed mine to prod, the google auth stop working with error "Try signing in with a different account." Next-auth is so f-in hell to deal with

  • @travisdelly377
    @travisdelly377 2 месяца назад

    This is a cool video, but most nextjs applications do not hold the database connections. Another video where you connect to an express server and do similar things would be helpful, although i'm sure i can take it from here.

  • @samsuh
    @samsuh Месяц назад

    at a high level, how would something like an upvote system work after you've set up the initial sign in? assuming everything works and you can authenticate a user into a page, and you have postgres set up, do you use something like an events side effect to ensure a user if authenticated before calling a server action to perform the upvote action? or is it simpler, like you check for user auth in the server action itself?

  • @chaodinsankamol616
    @chaodinsankamol616 2 месяца назад

    great! please make more video about facebook login

  • @dpno
    @dpno 2 месяца назад

    Thank you

  • @Jaimie-C
    @Jaimie-C 2 месяца назад

    If i were to use next.js as only the front end and have an express server as the backend would anything need to change from this auth setup?

  • @GiuseppeScrugli
    @GiuseppeScrugli Месяц назад

    I used keycloak and db session strategy. I don’t want to share jwt with browser. Btw do you know how to logout from google to make possible to login with different account?

  • @taulantmerlaku5528
    @taulantmerlaku5528 2 месяца назад

    What about asp net back end as an authentication provider with a token how does that work in next js. I havent seen any proper documentation regrading that so i don't know where or what to look for?

  • @abdulrafay1951
    @abdulrafay1951 4 месяца назад +1

    it would be great if you do same connection in react expo so we won't need to go for services like clerk, supabase auth

  • @dev-akeel
    @dev-akeel 3 месяца назад

    7:20 -d = enable detach mode
    31:40 No that's different. That is a package "server only". Use server is different. It is annotation for server actions not to enforce the code to be run on server.

  • @a89529294
    @a89529294 5 месяцев назад +1

    Thanks for the video, can you make a new one on using NextAuth with email/password login?

    • @Jackson_Zheng
      @Jackson_Zheng  5 месяцев назад +1

      If this video gets the channel over 4000 hours watch time (minimum criteria for monetisation), then I will do it.

    • @-UPH-KRISHNAM
      @-UPH-KRISHNAM 4 месяца назад

      @@Jackson_Zheng Imma watch this with multiple accounts just to increase watch time for that 😝😝

    • @Jaimie-C
      @Jaimie-C 2 месяца назад

      @@Jackson_Zheng i hope you make the video on email/passwords login!

    • @Jaimie-C
      @Jaimie-C 5 дней назад

      @@Jackson_Zheng Any chance you will do a email/password video using the same setup?

  • @alexdin1565
    @alexdin1565 4 месяца назад +1

    please can you make video about AuthJs v5 when user can login using a facebook account
    I searched for this topic and now on make video on youtube

  • @haoweizeng6709
    @haoweizeng6709 2 месяца назад

    why you don't need a code verifier ? I faced a issue that google oauth api tell me my code verifier is invalid

  • @-UPH-KRISHNAM
    @-UPH-KRISHNAM 4 месяца назад

    I had installed postgres on my local machine and was using postgresql on docker with the same port which caused me few hours of trouble, use different ports or disable your local pgservice

    • @Jackson_Zheng
      @Jackson_Zheng  4 месяца назад +1

      yeah, don't have more than one postgres service running at once.

    • @-UPH-KRISHNAM
      @-UPH-KRISHNAM 4 месяца назад

      @@Jackson_Zheng Also I wanted to thank you for this tutorial and the efforts you made for 'production' grade things.

  • @moroccan_pentester
    @moroccan_pentester 4 месяца назад

    how did your docker containers worked with no need to set up the networks?

    • @Jackson_Zheng
      @Jackson_Zheng  4 месяца назад +1

      docker works with localhost by default

    • @moroccan_pentester
      @moroccan_pentester 4 месяца назад

      @@Jackson_Zheng thank you for this amazing tutorial I learned a lot from it

  • @alexdin1565
    @alexdin1565 4 месяца назад

    please can you make a video about login using facebook?

  • @dominionebenezer4452
    @dominionebenezer4452 Месяц назад

    bro how did you do doxcker

  • @MihirAmanRaj
    @MihirAmanRaj 3 месяца назад

    what happens if you signed in with ur google account, but then u unlinked it, and also the session was erased, how will you sign in again to the same account with same or other google account?

    • @Jackson_Zheng
      @Jackson_Zheng  3 месяца назад

      @@MihirAmanRaj when the account is unlinked it deletes the Google OAuth information from the database. So if the user doesn't have another Google account linked, then signing in with the unlinked Google account will automatically relink it. The account is determined by the email (so the user can also sign into the account using the email address of the unlinked Google account if they want to). Unlinking the Google account only deletes the Google OAuth record from the database but the email record still remains in the "users" table.

    • @MihirAmanRaj
      @MihirAmanRaj 3 месяца назад +1

      @@Jackson_Zheng okay makes sense, i will surely try to implement it, i am using prisma btw for my own auth starter kit

  • @olivebishop3794
    @olivebishop3794 3 месяца назад

    can we have one with lucia auth

  • @ts3798
    @ts3798 4 месяца назад

    British AND Asian?! Can't go wrong.

  • @OnlyJavascript
    @OnlyJavascript 5 месяцев назад

    amazing.

  • @creativeartdesign4820
    @creativeartdesign4820 3 месяца назад

    I like the video but i did not like the styling part. because i dont use it i use tailwind.. only confusing..

  • @Learnwithjoseph
    @Learnwithjoseph 5 месяцев назад

    loved the d0cker part big up :_

  • @manjilunnobi
    @manjilunnobi 4 месяца назад

    Backup or restore database to website
    Transfer balance
    Admin edit/delete/disable/create
    Products buying user account
    Expired date products
    🎉🎉🎉🎉🎉🎉🎉🎉🎉

  • @breachr4696
    @breachr4696 Месяц назад

    Just my feedback but I thought this video was supposed to be about auth, yet half the video is just building a nextjs app.

    • @Jackson_Zheng
      @Jackson_Zheng  Месяц назад

      What were your original expectations for the video? I'm trying to figure out this RUclips thing so I'm probably going to miss more shots than I hit, but curious what you were originally thinking the video was going to be more like?