Next-Auth v5 is Almost Here! Learn it Fast on the NextJS App Router TODAY!

preview_player
Показать описание
Next-auth is an easy way to get started with authentication in your NextJS App Router application. Let's get it set up, and see how to secure routes, server actions, API routes and client and server API requests!

👉 VS Code theme and font? Night Wolf [black] and Operator Mono
👉 Terminal Theme and font? oh-my-posh with powerlevel10k_rainbow and SpaceMono NF

00:00 Introduction
00:20 Installation And Configuration
02:35 Adding A Provider
03:46 Signin And Signout
06:07 Building An Auth Button
08:38 Auth Middleware
10:34 Auth In Server Actions
11:37 Auth In API Routes
12:13 Authenticated Client Calls
13:03 Authenticated Server Calls
14:14 Outroduction
Рекомендации по теме
Комментарии
Автор

The best nextauth tutorial I have seen. Explaining it with all the NextJS features and explaining it with real auth. Other tuturials always use social cred and github. This is a major step up from that.

jordymaryns
Автор

Been really struggling to understand the purpose and use-case of API/ROUTE with Next. This video single handedly has gotten me to rethink my entire DB architecture.


MASSIVE thank you

sammavrs
Автор

I've been working on a project for school and I've recently been trying to find a simple auth solution. It just so happens that this video comes out today! 14 hours ago!! I'm amazed and pleased to say the least. This is perfect. Thank you so much.

lathryx
Автор

Thanks so much Jack! I feel like trying it just for the work you put in, but my goodness was it a nightmare when I recently tried the current version. I had to go with Auth0; next-auth docs are the definition of "the road to hell is paved with good intentions".

manomancan
Автор

Don't use betas in production, especially libraries that have a history of app breaking bugs that tend to have awful documentation (they rewrote them but the docs are still not great)! 😅

codernerd
Автор

Kind of exciting! I wrestled with v5 for a bit a few months ago, and it had a ways to go. I was trying to work with the token and providers and had to do some hacky stuff to get it working.

realbigsquid
Автор

I've used Nextauth a lot but curious about Lucia as well. Thanks for another great video!

jackn
Автор

first tut i see for u, i have to say explaining simply means you understand it deeply great tut 👍

TheStallion
Автор

I followed the NextAuth docs and still had issues, this video is more concise and effective than the official Auth js v5 documentation

oamenEmmy
Автор

Incredibly helpful video! One thing I wanted to point out is it seems the session data is still accessible from the AuthButton.Client component after the first render. I'm pretty sure this is due to the session object being stored upon validation so the data passed to the SessionProvider by AuthButtonServer is only used in that render cycle... I was able to add a session callback in the nextAuth config to modify the initial session object sent to the client instead and the values aside from name and email are now unavailable.

I may be mistaken but I wanted to leave this for anyone else! Immense thanks Jack!

matthewevans
Автор

Very very clear tutorial that answers all questions I had + nice job linking the code

connorchen
Автор

Thank you very much my dear professor. Necessary this update, a few days ago I had tested the next-auth: "5.0.0-beta.16" and there was some problem with the middleware.

_hugo_cruz
Автор

Amazing. I would love to see an example using auth.js with an database.

dominikkarbowski
Автор

thanks for tutorial, and i can't wait for the course :)

forsh
Автор

Jack, thank you lot! You're a real Master!

LeonidMaksimshin
Автор

thanks a lot, very helpful! and thanks for sharing the code!

mahfoudh_arous
Автор

Awesome, thanks a lot! I would be interested in setting roles for users (by connecting with an own database) and allowing only certain paths for admins or other users. I have dug through the auth v5 docs and played around with prisma but eventually made it worse lol.

vronus
Автор

Hey Jack, great video as always, I wished you added an implementation on how to update the session both client & server side at once,

I would love to see how you handle this one.

FitimBytyqi-mbpn
Автор

Awesome! What's that font you're using in you editor? Thanks in advance

aPinix
Автор

thanks! your to the point tutorials are perfect! :D

brikka