У нас вы можете посмотреть бесплатно Authentication in NodeJS - REST API with NodeJS and MySQL (2020) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Today we're gonna learn how implement Authentication in NodeJS. So, we'll be creating User Signup and User Login with Token based Authentication. 0:00 Intro 1:15 Install Bcryptjs, JsonWebToken, and Nodemon 4:12 Implement User Signup 13:49 Implement password Hashing 18:08 Implement Duplicate email check 22:37 Implement User Login 27:10 Generating access token 34:43 Setup Nodemon 36:39 Outro In the previous video we implemented Requests Data Validations. • Validate data in NodeJS - REST API with No... Here in this video we learn how to implement Token based Authentication in NodeJS. So, we'll add Signup functionality and the Login functionality. Download project files. https://github.com/tharindulucky/blog... In the Signup functionality, users can signup with Name, Email and Password. In our method, we'll check if that email already exists, if it does, it simply returns an error message, if it doesn't, it hashes the password and inserts that user in to the users table. We use Bcryptjs (https://www.npmjs.com/package/bcryptjs) for hashing passwords. In the Login functionality, users can login with Email and Password and our login method checks if here's a user in the users table with that email. If it doesn't it returns an error message. If it does, it then grab that user object and compares the passwords - the one user entered and and the one in the database. For comparing passwords we use an inbuilt function in Bcryptjs called compare. So, if the passwords match, then we proceed with generating an access token and include that in the response. So, the users can get that token and include that in their request header. So the API can authenticate the token and treat the user as a valid user. We use JsonWebToken package (https://www.npmjs.com/package/jsonweb...) for generating access token. So, that's how can implement Authentication in NodeJS. Then finally we setup Nodemon in our project. That's a development dependency. Currently each time we make a change, we have to restart the server. This can be a pain in the neck while developing. So, once Nodemon is setup, it's watching for the changes in the code and automatically restart the NodeJS server for us. So, that's a plus for the productivity. In the next tutorial we'll learn about Middlewares This is the part 8 of the tutorial series, How to Create REST API with NodeJS and MySQL using Express and Sequelize. Watch the Series from the beginning: • Create REST API with NodeJS and MySQL (2020) Hit Subscribe, smash the Like button and share with your friends. Visit my blog: http://coderaweso.me Follow me on Instagram : / coderaweso.me Like me on Facebook : / coderaweso.me Follow me on Twitter : / coderaweso_me