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.
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?
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 ) =(
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
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.
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')
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 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.
@@ScalableScriptsIt worked....When set SameSite="none" . It had to be in " " .the emitters also working. But still i get no cookies in application tab.
I have a similar problem, I don't get cookies on the application tab. go session options: Secure: false, HttpOnly: true, SameSite: http.SameSiteDefaultMode,
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.
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.
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
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 ..
@@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".
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.
I learnt many things from this video even though I am using angular from few years. Thanks a lot 🎉
Best teacher ever , I just love these angular /nestjs tutorials
This channel is soooo underrated. Keep up the great work.
Thank you so much for the great content.
can you please explain how to use How can I use cookies sent from backend with the canActive guards ?
This is great, but I didn't see you use JWT once. The title is very misleading
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?
hii did you find a solution for that problem ?
same problem
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 ) =(
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
Property 'form' has no initializer and is not definitely assigned in the constructor.
use form!: FormGroup; add the !
turn of the strict mode in the tsconfig.json file
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.
wow this was very great! thank you so much
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')
Same here
@@oax97 same here how did you ovecome this?
Excelent great Teacher are you. Thanks
Thank you so much! Clear explanation. I really like it
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.
Did you add credentials: true ?
@@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.
@@ScalableScriptsIt worked....When set SameSite="none" . It had to be in " " .the emitters also working. But still i get no cookies in application tab.
I have a similar problem, I don't get cookies on the application tab.
go session options:
Secure: false,
HttpOnly: true,
SameSite: http.SameSiteDefaultMode,
Yes this is the biggest problem with this code
This video is so good, you helped me a lot!! thank you so much!
really really nice, thanks man!
Thank you so much! Great tutorials
Excellent work!
Keep it up!😉
Thanks ^^
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.
Good tutorial!
I read that we should not subscribe to EventEmiitters in angular.
Can we just use session variables instead?
can you please elaborate?
Yeah you can use localstorage session
Very useful videos, thank you so much!
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.
thank you for this tutorial. Really helpful
Exactly what i needed! Great work 👏
Nice video!!! One question, can you do a route guard? Thanks
Excellent. You are the best
Thanks a lot
Can you make a video about auth guard?
Thank you so much
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
In 23:30 it does not work with your angular course :(
Did you find a solution?
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 ..
Wow man, these tutorials really help your explanation is very good.
keep it up. 🤟
The cookie is not created in the browser (please help)
The same with me!
Did you found the solution?
@@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".
its help me so much
thanks
Hello, Why we post register to localhost:8000, Everytime i want to register i have Eroror: Connection Refused
You need to build the backend or use the docker container. Check the description of the video and select the backend that you want
After I wrote this.http.post(...) in function submit, I got Unknown Error.
How can I use with canActivate?
is auth guard, have to generate guards
@@mcaddit6802 can you please explain more how can I do that?
you are 100% albanian
nie dziala
when i use { withCredentials: true }
and look the cookies, angular still does not save the coockies
i dont know why, any help?