OMG! This video is soooo informative! I learned Express restful API by watching UA-cam videos, and I started to learn Typescript recently. This video is one of the best tutorial of API dev and auth token I've watched! Thank you man!
This is exactly what I expected for chrismas this year ! A nice example of auth app with my favorites techno stack combine with Typescript ! What a perfect timing you got !
Great man, thanks for the tutorial🤘, though there's this one thing I would like to add: at 24:25, you have only added "if" and "else if" part, we should also add "else" part and return an error response, because if we don't add else part and if we enter wrong password for an existing user, we wont be able to get back any response back, and thus our API would stuck on that point forever. We can add something like this: example: bcryptjs.compare(password, user[0].password, (error, result) => { if (error) { return res.status(401).json({ message: 'Login Unsuccessful', errorMessage: error.message, error: error }); } else if (result) { } else { logging.error('Login Unsuccessful, wrong username and password'); return res.status(401).json({ message: 'Login Unsuccessful, wrong username and password' }); }
Thanks for the video. There is one thing I don't understand, what is your intention with the expireTimeInSeconds calculation ? I've just typed 600 for 10 minutes and the token expires 10 minutes after being generated. "jwt.sign(...jwtSecret, { algorithm: 'HS256', expiresIn: 600 });" or config.server.token.expireTime = 600;
dude, I love the way you discuss it, you might need to consider also adding validation in registration or login. likely a centralized validation function.
OMG! This video is soooo informative! I learned Express restful API by watching UA-cam videos, and I started to learn Typescript recently. This video is one of the best tutorial of API dev and auth token I've watched! Thank you man!
This is exactly what I expected for chrismas this year ! A nice example of auth app with my favorites techno stack combine with Typescript ! What a perfect timing you got !
I got you! Lemme know if any specific video ideas interest you!
Straight and clean explanation. Love it!
Such a perfect video.
Seriously.. I can't thank you enough for this...
No problem 😊
Great man, thanks for the tutorial🤘, though there's this one thing I would like to add: at 24:25, you have only added "if" and "else if" part, we should also add "else" part and return an error response, because if we don't add else part and if we enter wrong password for an existing user, we wont be able to get back any response back, and thus our API would stuck on that point forever.
We can add something like this:
example:
bcryptjs.compare(password, user[0].password, (error, result) => {
if (error) {
return res.status(401).json({
message: 'Login Unsuccessful',
errorMessage: error.message,
error: error
});
} else if (result) {
} else {
logging.error('Login Unsuccessful, wrong username and password');
return res.status(401).json({
message: 'Login Unsuccessful, wrong username and password'
});
}
Great, I would really love a video on mongodb models and the relations between each model
Thanks for the video.
There is one thing I don't understand, what is your intention with the expireTimeInSeconds calculation ?
I've just typed 600 for 10 minutes and the token expires 10 minutes after being generated.
"jwt.sign(...jwtSecret, { algorithm: 'HS256', expiresIn: 600 });"
or config.server.token.expireTime = 600;
I probably overcomplicated it.
Hi! Clean explanation! I was wondering, how can I do a logout using this scheme? (whitout using jwt's timeout)
Good question, I'll take a look
dude, I love the way you discuss it, you might need to consider also adding validation in registration or login. likely a centralized validation function.
Eventually down the road it will have that, I just wanna do as much basic stuff as I can right now. :)
How i hide the password field?
I think some videos on this app should be given two like buttons...
Absolute clean and informative!!!
Any graphql and ts tutorials coming?
You are amazing! Thank you!
Awesome dude, I just got to know your channel.
Thanks
Good shit my man
Hello, please can you do a forgot password
I can try :)
@@TheNerdyCanuck Thanks :)
I cant login it says unauthorised
Let me know if you have a link to your code and I can look.
Awesome Tutorial tkysm
nice but we re watching this to not read the documentation, and every time you suggest to read the documentation xd
Haha I know! I say that because if I don't the videos will be 3 hours long :P
@@TheNerdyCanuck let them be you rock man
Great. Thank you.
no problem!
Too Bad i wanted more on the typescript part :/