I have had a lot of experience and training in developing software. I was taught as well as it makes sense to just hide functionality from a user if they do not have access to it. unless some functionality is disabled until a certain condition is met like in the case of a submit button being disabled untill the form fields are valid, it greatly irritates a user when you show functionality that they cant use. Its just a psychological phenomena. So how do I hide things based on a users Role?
Hi. Great tutorial! I just have one problem, when a user is on dashboard page and they remove the /dashboard, i want it to not work and take them back to dashboard. How do i do that?
this is awesome, but Can you please tell me If I want to restrict a user from a specific HTML element / typescript method/ function inside the component(some functions/ elements should be accessible but some should not), thank you.
follow the same tutorial and just add ngif to component u want to hide and call canActivate() like this: *ngIf="authGuard.canActivate()" , also import authguard in component.ts
Nice, but I think there is an issue. User can just put a random invalid jwt token in the localstorage through browser console, and will have access to internal pages. Rather, it is better to have an async auth guard, that will call the api with the jwt token, and if the token is valid, only then the auth guard will return true.
@@letsprogram30 Yeah that makes sense indeed. May be its better to mention about this in your videos though, otherwise people end up making unsecured apps :D Btw, dont get me wrong, I am just giving feedback from audience POV. Great videos !
Bro really your videos more neat and clear... please post more videos bro... you get more viewers and subscribers.
Thanks you 🙂
Every time ur proving that ur a real genius 👌👌
Tnx from Argentina!
In which video of yours do you go over JWT with Angular?
I have had a lot of experience and training in developing software. I was taught as well as it makes sense to just hide functionality from a user if they do not have access to it. unless some functionality is disabled until a certain condition is met like in the case of a submit button being disabled untill the form fields are valid, it greatly irritates a user when you show functionality that they cant use. Its just a psychological phenomena. So how do I hide things based on a users Role?
you can use *ngIf with some conditions on div
@@blueSurfer Thanks !!!
The video was very helpful.
Thank you thank you
Do checkout my Blog : letsprogram.in
Nicely Explained.
Thank you. Good explanation , very clear and precise
You're welcome 🙂
@@letsprogram30 bro can you send this project github link
Hey, where can I find the whole video, with local storage and the login functions. Thank you so much
Sidhi baat no bakwas great. 👌
Haha thanks 🙂
Hi. Great tutorial! I just have one problem, when a user is on dashboard page and they remove the /dashboard, i want it to not work and take them back to dashboard. How do i do that?
You can use the router Service to navigate to any page that you like
awesome explanation .. can you please let me know if it is possible to have 2 can-activate() in1 auth guard
Thankyou Bro.awesome and very helpful video. Please make a video on Authentication &Authorization using JWT.Thankyou..
very helpful for me.thank you so much!
Hi, this is very good one , but this is not matching with you previous login video, Please share git hub repo link.
Keep Gng 💕👌
Which video is the video tht shows u already made the login, main, signup
but admin can use,
user components, how to deal with that?
great explanation
Hello , i have data register in database how i can replace "localstorage.getitem('token') ?
Thank YOu 😉
Your welcome 🤗
this is awesome, but Can you please tell me If I want to restrict a user from a specific HTML element / typescript method/ function inside the component(some functions/ elements should be accessible but some should not), thank you.
You should use access modifier to achieve this
follow the same tutorial and just add ngif to component u want to hide and call canActivate() like this: *ngIf="authGuard.canActivate()" , also import authguard in component.ts
what backend stack do you use?
It's just fake creation without backend, just explained about what to do in frontend side
hlw sir firstly u have to create a page step by step or u provide code...then this video is usefull
This is where you realise the hard part ins't coding but thinking your website out
How can we hide the about,contactus Component , instead of giving alert ?
Just make use that condition inside the template to hide and show using ngIf
Very good video, can I have the source code please?
Nice, but I think there is an issue.
User can just put a random invalid jwt token in the localstorage through browser console, and will have access to internal pages.
Rather, it is better to have an async auth guard, that will call the api with the jwt token, and if the token is valid, only then the auth guard will return true.
This is just for the demo purpose where there was no backend involved 🙂
@@letsprogram30 Yeah that makes sense indeed. May be its better to mention about this in your videos though, otherwise people end up making unsecured apps :D
Btw, dont get me wrong, I am just giving feedback from audience POV. Great videos !
@@jeetadhikari3629 I highly appreciate your feedback bro🙂
I will make sure next time to mention the same🙂🙏
How to create the login which u have created here
This video is only for auth guards, please upload video for whole login functionality
Sure will include that in next video
@@letsprogram30 i hope so
Telegram not to working
can i make this method with keycloak authentification?
Yes you can
Where can I find the code?
please can u share the code
Bro can you please share the source code
Can I do this if i have logged in using json-server ?? Please reply me... I need help
Yes
@@letsprogram30 But I don't have token there .. what should I do ?
please put this full code in your description
When I clicked logout still the token is present? And it going to main page. Have you faced this and solution please?
On logout method Just do localstorage.clear()
@@letsprogram30 thank you very much for your quick response
@@s.balaji5016 you're welcome 🙂
Hiii....
Can any one help me....???
Reactive form----
Curd...
Select options....
I m not abl to edit and bind the select....
Plz help me..... ☹️☹️☹️☹️
Well explained 🤌
Hi brother Really nice video.. can I get access to the code ?
Hi, i don't want show about us , contact page to other users. How can I do that?
Just check and store the session who has logged in and you can use *ngIf to hide
Amazing!
Very Helpful.. Thanks :)
You're welcome 😊
can u show me full source code for login and signup?
Hello, full project login with CRUD operation. 🙏🙏🙏
I do have video created on above mentioned topics
Hi. Where is the code
Please provide entire code
Can you please send me the source code of this
Please add GitHub link also.
Soon I am adding GitHub links for all th videos
@@letsprogram30 hurry up
Source code? for the UI.
The other video was good.
Connect with me on telegram
bro can share you project on github
is there a link to this?
geat work !! source code please
😊😊😊
what backend stack do you use?
It's just fake creation without backend, just explained about what to do in frontend side
@@letsprogram30 oh i see, thank you my friend