In this episode we are going to create a node.js api that is going to handle Authentication for us in any application we want to use it in.
We are going to cover an authentication method using jwt. We will use mongodb as our database, mongoose to create models and to connect to our express server, bcryptjs to hash passwords and jwt to check for private routes.
❤Become a patreon for exclusive videos and more!
? Things covered in this video:
00:02:32 Setting up express
00:08:12 Connecting to a database
00:14:22 .env files
00:16:39 Creating models in mongoose
00:19:34 Registering a user
00:25:40 Validation with Joi
00:42:35 Hashing passwords
00:48:53 Setting up the login route
00:57:25 Adding jsonwebtokens to our auth
01:03:25 Creating private routes with jwt
? Follow me on:
LAKEY INSPIRED – Me 2 (Feat. Julian Avila)
Music By: https://soundcloud.com/lakeyinspired
Track Name: “Every Morning”
Music By: Dj Quads @ https://soundcloud.com/aka-dj-quads
Creative Commons — Attribution-ShareAlike 3.0 Unported— CC BY-SA 3.0
#nodejs #authentication #api