Angular JWT Authentication

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024

Комментарии • 64

  • @romanpikulenko
    @romanpikulenko 8 месяцев назад +2

    This is an incredible lesson. I've been looking for information of how to implement angular + django backend authentication for so long and only here I've found a comprehensive instraction and explanation. Thanks to the author.

  • @vircycure
    @vircycure Год назад +1

    I learnt many things from this video even though I am using angular from few years. Thanks a lot 🎉

  • @davicampos802
    @davicampos802 3 года назад +5

    Best teacher ever , I just love these angular /nestjs tutorials

  • @pemessh
    @pemessh 2 года назад +1

    This channel is soooo underrated. Keep up the great work.
    Thank you so much for the great content.

  • @AboChicheKurdi
    @AboChicheKurdi Год назад

    can you please explain how to use How can I use cookies sent from backend with the canActive guards ?

  • @kyleryxn
    @kyleryxn 2 года назад +1

    This is great, but I didn't see you use JWT once. The title is very misleading

  • @neoszweb
    @neoszweb 2 года назад +3

    Thank you so much for your tutorials. They are very precious!
    It seems when I try to call the /api/user endpoint, the cookie is not correctly retrieved from the request and it returns null all the time.
    Any idea?

  • @nedzk
    @nedzk 9 месяцев назад

    I have a doubt, all of these concepts worked in my localhost, but when I deployed it, the Login Controller (rule that set jwt cookie) doesn't work more. (I receive the cookies "__stripe_sid" and "__stripe_sid" instead jwt token ) =(

  • @erdavog
    @erdavog 10 месяцев назад

    HI!!, I have a question, when i use postman to test the login it works perfectly, i can see the cookie, but when I tried to login through the front end using angular sending the required data, it works but i could not see the cookie created in the front end port, i followed your tutorial for django and it is the same as yours. Thank you

  • @mikha2880
    @mikha2880 3 года назад +4

    Property 'form' has no initializer and is not definitely assigned in the constructor.

    • @JEBJOSH
      @JEBJOSH 2 года назад +3

      use form!: FormGroup; add the !

    • @btryx9378
      @btryx9378 2 года назад

      turn of the strict mode in the tsconfig.json file

  • @pankajpawar2858
    @pankajpawar2858 3 года назад

    Awesome Tutorial...
    but, i have few questions.
    if we store token in httponly cookie then do we need to refresh the token ?
    and could you tell that here we using cookie time 1 day This is cookie expiry time, this is not token expiring time,
    Because, if i use jwt Token instead of sanctum Token in cookie then which time i used to check validity of token. cookie time or token time ?
    And Is sanctum token has no expiring time like JWT Token ?
    Pls Answer Thanks.

  • @rebecaelida954
    @rebecaelida954 Год назад

    wow this was very great! thank you so much

  • @skalippanbalippan6972
    @skalippanbalippan6972 3 года назад +3

    I am getting this error when I run the cmd: docker exec backend /bin/sh start.sh
    SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name does not resolve (SQL: select * from information_schema.tables where table_schema = auth and table_name = migrations and table_type = 'BASE TABLE')

    • @oax97
      @oax97 3 года назад

      Same here

    • @rohithkoteval1785
      @rohithkoteval1785 2 года назад

      @@oax97 same here how did you ovecome this?

  • @jonathancolorado2998
    @jonathancolorado2998 2 года назад

    Excelent great Teacher are you. Thanks

  • @denizyldz1860
    @denizyldz1860 2 года назад

    Thank you so much! Clear explanation. I really like it

  • @prashantrao9456
    @prashantrao9456 3 года назад +4

    when I login there is no cookie. I have set httponly:true in set_cookie in django.
    Its working in postman but not Angular. Can you explain why??
    And I can see the cookie in network tab and there is a warning with it. which says-
    this set-cookie didn't specify a samesite attribute and was default to samesite=lax nd was blocked because it came from cross-site response which is not the response to top level navigation.the set cookie had to have been set with samesite=none to enable cross site usage.
    And I set samesite=None in django.. but still got the same error.

    • @ScalableScripts
      @ScalableScripts  3 года назад

      Did you add credentials: true ?

    • @prashantrao9456
      @prashantrao9456 3 года назад

      @@ScalableScripts yes... I did the same as you.. And when i run it in Firefox i got the error to add "secure" Parameter in set_cookie. And the previous error is in chrome.

    • @prashantrao9456
      @prashantrao9456 3 года назад

      @@ScalableScriptsIt worked....When set SameSite="none" . It had to be in " " .the emitters also working. But still i get no cookies in application tab.

    • @alexanderpolyakov9217
      @alexanderpolyakov9217 3 года назад

      I have a similar problem, I don't get cookies on the application tab.
      go session options:
      Secure: false,
      HttpOnly: true,
      SameSite: http.SameSiteDefaultMode,

    • @Barricadez
      @Barricadez 3 года назад +1

      Yes this is the biggest problem with this code

  • @isadora-lt6ns
    @isadora-lt6ns Год назад

    This video is so good, you helped me a lot!! thank you so much!

  • @juanarango4917
    @juanarango4917 Год назад

    really really nice, thanks man!

  • @andreyklepikov7084
    @andreyklepikov7084 3 года назад

    Thank you so much! Great tutorials

  • @ardilawar66
    @ardilawar66 Год назад

    Excellent work!
    Keep it up!😉

  • @emreaka3965
    @emreaka3965 2 года назад +1

    Thanks ^^

  • @НиколайСергеевич-л5в

    Hello. I'm new to Angular. I need to make an asynchronous validator for email on frontend. It will check in the database whether there is a user with such an email or not, if there is, then do not register. I think there should be another @Get('users') method on the backend that returns all users, after which it should be accessed on the frontend? Help me with some advice.

  • @chiranshuadik
    @chiranshuadik 3 года назад +1

    Good tutorial!
    I read that we should not subscribe to EventEmiitters in angular.
    Can we just use session variables instead?
    can you please elaborate?

  • @mike199862
    @mike199862 3 года назад

    Very useful videos, thank you so much!

  • @Luis-hc1dl
    @Luis-hc1dl 9 дней назад

    Really nice video, if anyone has problems with the cookie not being sent with the set-cookie, i have a repo following this channel nest and angular tutorial, with update for secure cookies.

  • @izzyblackout1090
    @izzyblackout1090 3 года назад

    thank you for this tutorial. Really helpful

  • @taamcyat
    @taamcyat 2 года назад

    Exactly what i needed! Great work 👏

  • @FranBoy7
    @FranBoy7 3 года назад

    Nice video!!! One question, can you do a route guard? Thanks

  • @amlshohdy6413
    @amlshohdy6413 3 года назад

    Excellent. You are the best
    Thanks a lot
    Can you make a video about auth guard?

  • @daviddonadze221
    @daviddonadze221 3 года назад

    Thank you so much

  • @aissatouseye1958
    @aissatouseye1958 2 года назад

    when i set with credential to true i had cors errors. I dont have solved it yet . Then i used HttpClient , and Headers but i have 400 error code . But i my postman login the token comes but not in my angular projet . my mind is aching , can you please help me out

  • @blaze9452
    @blaze9452 2 года назад +2

    In 23:30 it does not work with your angular course :(

    • @zocmihov
      @zocmihov 2 года назад

      Did you find a solution?

  • @haruboss_
    @haruboss_ 2 года назад

    hey, I liked your code extantion for fast development without syntax error, can you please share the name of angular extention with me, please please ..

  • @thaminduKavinda
    @thaminduKavinda 3 года назад

    Wow man, these tutorials really help your explanation is very good.
    keep it up. 🤟
    The cookie is not created in the browser (please help)

    • @isaquiassebastiaomarques2529
      @isaquiassebastiaomarques2529 2 года назад

      The same with me!
      Did you found the solution?

    • @emreaka3965
      @emreaka3965 2 года назад

      @@isaquiassebastiaomarques2529 backend's and frontend's url scheme must be the same. for example both should be HTTPS or HTTP. If this is not possible, you should set SameSite value to "none".

  • @netanelarye7547
    @netanelarye7547 2 года назад

    its help me so much

  • @jawhermahmoudi8649
    @jawhermahmoudi8649 3 года назад

    thanks

  • @emirmustafoski2405
    @emirmustafoski2405 3 года назад

    Hello, Why we post register to localhost:8000, Everytime i want to register i have Eroror: Connection Refused

    • @ScalableScripts
      @ScalableScripts  3 года назад

      You need to build the backend or use the docker container. Check the description of the video and select the backend that you want

  • @难受-z2g
    @难受-z2g 2 года назад

    After I wrote this.http.post(...) in function submit, I got Unknown Error.

  • @ignacioruiz7094
    @ignacioruiz7094 3 года назад

    How can I use with canActivate?

    • @mcaddit6802
      @mcaddit6802 2 года назад

      is auth guard, have to generate guards

    • @rezanrasoul2286
      @rezanrasoul2286 Год назад

      @@mcaddit6802 can you please explain more how can I do that?

  • @NebihTV
    @NebihTV 2 года назад +1

    you are 100% albanian

  • @Pelakk
    @Pelakk 3 года назад

    nie dziala

  • @ahmjksjssd
    @ahmjksjssd 2 года назад

    when i use { withCredentials: true }
    and look the cookies, angular still does not save the coockies
    i dont know why, any help?