Email Password Auth API using Express JSON WebToken | Access Token | Reset Password | Tamil Skillhub

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] angular then package name rest login sign up Express okay version 1.0 on default then description back end API for email password email password authentication okay email password authentication then entry point on the index.js file done then test command is rest Express node then APA um reset password then Json JWT which means Json web token uh Json token then reset node later okay users okay sorry yes which will project on the Creator talking glass then without the visual Port City codes so npm my uh Express [Music] Library so in the library and the package include iron then node mod is folder create iron package the iPhone log.js okay so create action then clear then among the index.js starting point okay foreign [Music] prepare off Road okay then is foreign foreign node mod index.js okay so opening npm startup npm start application set title node monitor search is so okay so routes so that's why routes in the code is foreign foreign are um bridge bridge so the username and password username then password system okay then these are on the create up already representative then my local environment foreign [Music] local so servers three of three complete okay configuring foreign [Music] open Monday so on the connection string URL password password foreign connect connect to mongodb okay Dot connected like DB connection it's like string okay string and photo like in the connection string on the amount of the paste here on the password like system Looking Glass sorry system okay system then test test database rest iPhone login of dot environment dot config of Bangla so if on the dot environment underscore connection string okay so DB connections along the use uh new View person true then use reuse Unified angular topology true then database sorry const database is equal to Mongoose dot connection like error console.log of error okay then database dot on off connectedness then console DOT log of database connector database connected data base connected new URL okay use using your username use unified topology topology so so on the start editor then database in the connected solution is Dot foreign [Music] to use it Pima cons spelling mistake constantly user schema key holder new Mongoose Dot keema of email okay first Stringer then sorry ah yeah string then password then reset password token okay token trim then reset passwords of date of England date format then the user schema which is const user recorder Mongoose dot model of this is user data database lab like in the user scheme on the password [Music] equal to user OKAY model that on the export money user then other characters folder like uh like uh authentication and user create then login materials like index structures Express equal to Express um get off test okay then request response response dot send off I mean response dot uh not send response dot Json of organizations uh tab I mean AP testing successful Aba testing successful Triple C portion okay Library testing successful so allow the router about the like router on the like Express so const router equal to X Plus Dot router of again last Express dot router Dot export it's equal to router export manager then on the road okay routes okay routes is equal to dot slash router then app Dot use sorry app dot use of um slash AP okay slash API then approach okay then depending on the postman uh then localhost three thousand slash API slash test okay response APA testing successful Okay then if I want the like user on the create line user create the router dot post okay router dot post off slash user okay slash user doesn't like the request response process equal to request dot body okay requested body learning email password user equal to a weight use OK Google dot find foreign if if not of user is not suppose you use the relay enough like user already existing yeah then response Dot status of uh two naught one dot Json sorry uh I think four not four okay four not four dot Json off message user already exist okay then hash password user is online so as to password equal to away Crypt okay also be creeping around the like uh B Crypt okay Raw B Crypt J is okay so a weight of B credit dot hash of like password then another self number like uh 10 okay so new user of email then password on this password okay then in the user on this save away go to user sorry new foreign message user created okay Postman foreign cancel that question foreign I mean three thousand sorry three thousand slash APA slash user okay user then you'll learn the body on the raw data with the Json type cell model like email comments clinical but gmail.com okay password then again sorry users use okay but not found Isla so that's why two not one okay response dot status of two mark one with teeth foreign [Music] reload data users okay uses TB length like Tamil Scala download password on the server is so user created with status code on the two networks okay so the user on the create texture then in the user on the like authenticate using for Json laptop in which user controls find funny then next time another two days three days so but reference gmail.com router Dot post off slash Authenticator like next request uh next time so first email password okay request dot body okay then const user is equal to awake user dot find one of email okay if not user opening not user user number then return response dot status of 404 dot Json off message like in a message like user sorry double quotes user not function okay user not found error then line on the closed then return functions on the bracket curly braces suppose users weight of B B Crypt uh dot compare of uh password like password then use a Twitter encrypted password then if password match suppose if it's not match okay if password foreign message in incorrect incorrect password [Music] format incorrect password like suppose the user on the match in the chapter number like first on the token generate ability which is utils index.js index dot j is failure const generate foreign foreign sine of ID equal to user dot ID okay ID with then process dot uh e n d dot C sorry C secret key okay the secret key which is secret key then the secret key is secret key secret key foreign [Music] token off search generate token off users so const generate token is equal to required sorry to require of dot sorry double dot slash um utils it is [Music] original format of then depending on the token generated post then body layer like username password Json username password then uh Authentication exactly generate token error General token is not a function it is okay so exports so that's fine router Dot get uh get off slash data then um model middleware along the index.js index.js then sorry three index .js const verify token okay angular verify token off the verification or middleware function on the create so verification request response then next call controller like next uh middleware of the call control okay then foreign dot headers dot or sorry authorization authorization if not of fourth character suppose response sorry response Dot status of 4.1 dot Json off message missing token okay then token equal to hot header dot split off space of one array okay library now comes to j w t equal to require of Json so const then jwd dot where if dot sorry Dot verify of uh token okay token then process dot secret key events in the environment dot secret key okay then uh error then B code data okay sorry if if then return response dot status of four not three dot Json off message skin invalid token okay invalid token then suppose uh about the user or user on the D code uh weight uh user dot uh fine uh one of like uh ideas so underscore ID like user dot uh foreign status of 404 dot Json off suppose uh experience of [Music] foreign [Music] so um like so very excited verify token comma uh first sorry uh request um response dot um Json off message exponentiation welcome comma 3. welcome uh dollar request dot uh user dot email okay email this is protected data okay foreign [Music] 3000 I APA um authorization request authorization verify token foreign cancel so missing token request dot header dot authorization foreign Panama [Music] [Music] like APA 10. so router Dot post off slash preset password okay reset password off a sync request response Network so first on the email link again [Music] request dot body okay then find a user with the email address equal to wait user dot find by find one okay find one off email foreign user linear return response dot status of four not four dot Json off message to user lock phone token is equal to math Dot random Mouse dot two strings off 36 dot slice of infinite okay I like six six length random number one the generate controllers then user dot or reset foreign token then sorry line then user dot reset password expire so gangla expires equal to date dot now of Plus milliseconds like three six uh four five okay uh [Music] language then algorithm like uh const ants for the transporter is equal to node mail okay node uh transporter okay transporter node mail libraries sorry require of no yeah username but gmail.com constant [Music] the message equal to from sorry const ant from comments we will have a gmail.com then two on the user Dot uh email okay user dot email for less then subject okay subject password reset request password reset requested foreign because u r someone else has requested yeah password reset for your account okay so slash in slash in please use the use the following token token to reset your password following token to reset your password please ignore this please use the following please use then uh please use that following token okay following token to reset your account if you didn't request a password request please ignore this email okay suppose some mistakes then here sorry error info okay status of status of for for not four dot Json off message something then uh wrong try again okay try again console.log of status of 200 so if error number so suppose so uh response dot status of the status of so response dot status of foreign message email sent okay plus V4 Dot response okay Suppose there are centers then password reset menu so password reset email sent okay then click on the reset password with the username Okay so post localhost 3000 APA free shift reset password then modular Raw Json off e e sorry email Tamil at gmail.com password reset email send okay so we're gonna send that it's okay then depending on the Gmail login Gmail so password reset password reset request is router Dot get off uh reset password okay reset password comma sorry request response okay so request response reset password is const ant token okay request start params so router Dot foreign user dot find one more reset password sorry reset password token token then reset password Express expects on the like uh greater than sorry dollar greater than uh date dot now so on the time on the 30th so in the time is suppose if not of us written response dot status of 404 Dot message dot dot Json dot Json off message token then password hash cos lot of angular hash password um B Crypt of password comma t Okay Okay password hash hash password then user dot res sorry eraser dot reset password token user dot reset password experience then wait user dot save user on the save on internet connection response dot Json off response.json off message password reset successfully okay foreign [Music] Json off password okay new password okay new passwords zero reset password so then router that post off reset password slash talking some issue so a package send invalid token okay token on the invalid and solidity foreign [Music] foreign password reset successfully okay okay um [Music] authentication cover like username password foreign thank you for watching
Info
Channel: Tamil Skillhub
Views: 3,638
Rating: undefined out of 5
Keywords: Email authenticaiton, password authentication, Json web token, jsonwebtoken tuttorial, Authentication tutorial, Rest password, reset password acccess code sent via email, reset password using access code, creation of rest api, Email/Password authentication, Access protected resource using token, access token, access token tutorial, rest api using express, rest api using node
Id: z6nvEwCu09s
Channel Id: undefined
Length: 65min 11sec (3911 seconds)
Published: Tue Mar 28 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.