Тёмный

NextAuth Tutorial | Part 1 - Setup and Email Provider 

CodeDunks
Подписаться 7 тыс.
Просмотров 33 тыс.
50% 1

We will be looking at how to setup authentication in your next.js application using the open-source library known as NextAuth.js
This library is a pleasure to use and really makes setting up authentication in your next.js application a breeze.
In this video we are going to look at how to install and setup the library, as well setting up the Email passwordless provider which I believe is the next generation of authentication. We will also be configuring prisma and its adapter as our database solution for the authentication.
Starter project github: github.com/leoroese/nextauth-...
Timestamps:
0:00 Intro
2:00 install library
4:40 Prisma adapter
9:00 smtp gmail
13:00 nextAuth setup
26:00 getToken
28:00 protected route
29:00 serverside rendered

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@behnamaboutalebi5220
@behnamaboutalebi5220 2 года назад
Leo, your explanation is pretty much awesome, your presentation is pretty much great, and thanks for the pretty much quality content. Keep on the good job
@CodeDunks
@CodeDunks 2 года назад
Much appreciated!
@joepetrillo6185
@joepetrillo6185 Год назад
I pretty much agree
@sumukhakb2701
@sumukhakb2701 2 года назад
Amazing tutorial. It is quick and straight to the point.
@SleepeJobs
@SleepeJobs 2 года назад
Tried for almost a week to use the Typeorm adapter. One more short video can be extremely helpful
@YiannisChristodoulou
@YiannisChristodoulou 2 года назад
Very good tutorial. Thank you so much!
@realisticprogramming
@realisticprogramming Год назад
Pretty much... a good tutorial. Thanks!
@hbela1000
@hbela1000 2 года назад
simply put, awesome.
@shawn-skull
@shawn-skull Год назад
Jesus Christ!! PRETTY MUCH valuable information, difficult to find in other videos. 💀
@loganj6203
@loganj6203 2 года назад
Amazing!
@k2nnethtan949
@k2nnethtan949 2 года назад
Thumbs up, I love your explanation. :) By the way, do you manage to do another section for the authorization such as accessing pages accordingly to the roles of different groups of users?
@skverskk
@skverskk 2 года назад
Good stuff
@oguzhankandakoglu1360
@oguzhankandakoglu1360 10 месяцев назад
Thanks!
@gcapedro
@gcapedro 2 года назад
Very Good Leo !! Is it Possible to use NextAuth when NextJS Frontend is totally separated from Prisma Backend which is gonna be on a different folder and host ? Example: Next on Vercel and Prisma on Digital Ocean
@CodeDunks
@CodeDunks 2 года назад
This might be what you are looking for cloudcoders.xyz/blog/nextauth-credentials-provider-with-external-api-and-login-page/
@pablofreitasmachado8076
@pablofreitasmachado8076 2 года назад
You tutorial is Great. It helped me a lot, but since v4 has moved out of beta, there were some breaking changes
@jjuuiiccyyjj
@jjuuiiccyyjj 2 года назад
next auth ya bish, hahaha great tutorial
@k2nnethtan949
@k2nnethtan949 2 года назад
I'm using SQLServer, and managed to sent email but once click on email link, it prompt the error, "'Invalid `p.user.create()` invocation in ' +... + Argument id for data.id is missing...", any advise?
@kaustubhdwivedi1729
@kaustubhdwivedi1729 2 года назад
how to get the email username and password while using Email provider verification?
@m0rt068
@m0rt068 Год назад
You can't get the email username and password. But what you can do is add a settings page (or something) and allow user to use a username and save that to your database user table. Nextauth will still send an email when a user tries to log in but when they log in you can get the user from your db and show the username.
@kunliu9785
@kunliu9785 2 года назад
what do i put for the email_server?
@DnKZone
@DnKZone 2 года назад
If I add email login then how can I get user's name?
@DevBishwasBh
@DevBishwasBh 2 года назад
Please do django rest framework with next auth.
@brendagalindo9300
@brendagalindo9300 Год назад
I have this problem when I press the button that send me on my email and the pages show me this "Unable to sign in The sign in link is no longer valid. It may have been used already or it may have expired." Someone else have this problem??
@DevBishwasBh
@DevBishwasBh 2 года назад
Thanks a lot, but please do NextAuth with Django Rest Framework, with email and password. Also, adding OAuth on the same tutorial will be great. I am desperetely waiting for your response.
@Kats0unam1
@Kats0unam1 Год назад
lol
@lanceandreijuat3953
@lanceandreijuat3953 2 года назад
What will happen if the less secure app access is removed?
@tubbylardman
@tubbylardman Год назад
Use "app password" instead. Setup on the same security screen shown in the video.
@mehmetsayn573
@mehmetsayn573 2 года назад
this next-auth-example autdated. They opened new pr for it. I think they will update it as soon as possible
@CodeDunks
@CodeDunks 2 года назад
Yeah version 4 was in beta when I made this video, but I figured it wouldn’t change that much where it would become outdated. I haven’t checked the update but what in the PR makes you say this video is outdated?
@kaisian4940
@kaisian4940 2 года назад
tried using this library recently. Not really a fan of it, lacks of docs on how to customize the data to insert and update to database
@Isaac-zs3db
@Isaac-zs3db 2 года назад
Watching this video rn to see how to do that too... I want to use Google Provider but store user info into the database. Probably do that in one of the callbacks after they sign in
@CodeDunks
@CodeDunks 2 года назад
As Isaac mentioned the custom callbacks would probably be the way to do it. In part 3 I discuss it a little more
@aicragify
@aicragify 2 года назад
Does this works with mongodb?
@CodeDunks
@CodeDunks 2 года назад
It should. next-auth.js.org/adapters/mongodb
@alexserver
@alexserver 2 года назад
I had to watch this tutorial in 0.5x, you go very fast ! could you please slow down your scrolling in the next videos ?
@CodeDunks
@CodeDunks 2 года назад
Appreciate the feedback. Will do from now on
@josephdburdick
@josephdburdick 2 года назад
You can change the playback speed from RU-vid
@ferryops
@ferryops Год назад
this really helped me, thank you
Далее
Осторожно селеба идет 😂
00:16
Просмотров 452 тыс.
WE COOKED A SHRIMP KEBAB  #recipe #barbecue #food
00:21
Просмотров 133 тыс.
Set up Google OAuth with Next.js using Next-Auth!
21:00
How To Use The Email Provider - Auth.js
38:18
Просмотров 3,1 тыс.