Authentication with JSON Web Tokens using NodeJS, Express, Typescript & Mongo DB

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 37

  • @mike30476
    @mike30476 3 роки тому +1

    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!

  • @florentplomb4743
    @florentplomb4743 4 роки тому +3

    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 !

    • @TheNerdyCanuck
      @TheNerdyCanuck  4 роки тому

      I got you! Lemme know if any specific video ideas interest you!

  • @Harduex
    @Harduex 3 роки тому +1

    Straight and clean explanation. Love it!

  • @taslimmuhammedmoosa3720
    @taslimmuhammedmoosa3720 2 роки тому +1

    Such a perfect video.

  • @You3gs
    @You3gs 3 роки тому +1

    Seriously.. I can't thank you enough for this...

  • @aayushsolanki5260
    @aayushsolanki5260 2 роки тому +1

    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'
    });
    }

  • @slka3272
    @slka3272 4 роки тому +2

    Great, I would really love a video on mongodb models and the relations between each model

  • @asubijotaka7374
    @asubijotaka7374 3 роки тому +2

    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;

  • @favioluna5940
    @favioluna5940 2 роки тому +1

    Hi! Clean explanation! I was wondering, how can I do a logout using this scheme? (whitout using jwt's timeout)

  • @hypealex
    @hypealex 3 роки тому +1

    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.

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 роки тому +1

      Eventually down the road it will have that, I just wanna do as much basic stuff as I can right now. :)

  • @hassanshahid1638
    @hassanshahid1638 Рік тому

    How i hide the password field?

  • @KuRoiBatusai
    @KuRoiBatusai 3 роки тому

  • @imiebaka
    @imiebaka 2 роки тому +1

    I think some videos on this app should be given two like buttons...

  • @usmanmughal5916
    @usmanmughal5916 3 роки тому

    Absolute clean and informative!!!

  • @juanmanueldaza
    @juanmanueldaza 3 роки тому +1

    You are amazing! Thank you!

  • @Collins01
    @Collins01 3 роки тому +1

    Awesome dude, I just got to know your channel.
    Thanks

  • @achrafderdak9357
    @achrafderdak9357 4 роки тому +1

    Good shit my man

  • @valentineoffiah5068
    @valentineoffiah5068 4 роки тому +1

    Hello, please can you do a forgot password

  • @romeshrajkomalarani6984
    @romeshrajkomalarani6984 2 роки тому

    I cant login it says unauthorised

    • @TheNerdyCanuck
      @TheNerdyCanuck  2 роки тому

      Let me know if you have a link to your code and I can look.

  • @cuberos7430
    @cuberos7430 3 роки тому +1

    Awesome Tutorial tkysm

  • @Mr.Mouihbi
    @Mr.Mouihbi 3 роки тому +3

    nice but we re watching this to not read the documentation, and every time you suggest to read the documentation xd

    • @TheNerdyCanuck
      @TheNerdyCanuck  3 роки тому +3

      Haha I know! I say that because if I don't the videos will be 3 hours long :P

    • @Mr.Mouihbi
      @Mr.Mouihbi 3 роки тому +3

      @@TheNerdyCanuck let them be you rock man

  • @mehmetaltinsoy525
    @mehmetaltinsoy525 4 роки тому +1

    Great. Thank you.

  • @mathnewph
    @mathnewph 3 роки тому

    Too Bad i wanted more on the typescript part :/