Комментарии:
Hai sir I am getting "JWT strings must contain exactly 2 period characters.Found:0 " in backend while logging in
Ответитьpls never zoom again and less fucking add
ОтветитьThanks a lot for sharing this video.
ОтветитьToo Nice
for real project where we are storing token?
Very useful tutorial and channel, friend!
ОтветитьThank you very much, i really appreciate the detailed explanation.
ОтветитьHi bro canActivate is deprecated in angular so can you give me new code for that one
Ответить@Learn Programming Yourself - I am having a small issue; my role is coming back as an empty array; what should I do ?
ОтветитьCan I get your email id?
ОтветитьHello ,
I have one problem i am getting the roles array blank if the api was fired from frontend, but from postman the response is Ok. can u help ?
Hiii thank you so much for these tutorials they really help. If you don't mind i added an angular component register new agent but i didn't how to connect it with the back seeing that it needs a token to have access to the back. Please help
Ответитьgetting error (implements CanActivate)'CanActivate' is deprecated.ts(6385)
index.d.ts(301, 4): The declaration was marked as deprecated here. i am using Angular 16.0.1 is this beacuse of version cange?
Nice tutorial on the topic and very detailed explanation. Thanks very much for sharing the info
ОтветитьThank you so much, I really really appreciate that, keep up bro :)
Ответитьexport class UserAuthService {
constructor() {}
public setRoles (roles: []){
localStorage.setIt
}
public getRoles(){
return JSON.parse(localStorage.getItem("roles));
public setToken(jwtToken:string) {
localStorage.setItem("jutToken", jwtToken);
}
public getToken(): string{ return localStorage.getItem("jutToken");
}
public clear(){
localStorage.clear();
}
public isLoggedIn(){
return this.getRoles ()&& this.getToken();
It shows this error on compile time
Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'. ts(2345)
On user-auth.service
Please tell me how to rectify it
Thanks for sharing the knowledge from this videos I solved my many issues also can you please provide a video on storing the user data into session instead of storing the data into local storage
ОтветитьWhen implementing all this, I get a 403 error on the pages (components) where I don't want people to be logged in.
What could be the cause ?
The header "No-Auth" is not set when people are not logged in.
Thanks for the hard work
ОтветитьHow to fix cors error ?
Ответитьvery useful I am beginner and finally I am able to do thank you so much
Ответитьcan you say the other way to save the user data other than local storage.
ОтветитьCould you please explain implementation for shared services or Cookies or Sessions to store data instead of local storage?
Ответитьplease can tell me what is the version of node js you used in this project
ОтветитьThank you so much sir for explaining each and every concepts. Now because of you I can build my own projects 🙏🙏.
Ответитьyour genius buddy thank you so much
ОтветитьThankyou for the hardwork. I have one question though,the part where you used the *ngIf to hide and show the User and Admin dashboard is not really working for me.when I logged in the dashboard for specific role was supposed to be visible on the nav bar,unfortanatly , only the Home and logout button are visible when i logged in as User or Admin.
any suggestion why it's doing that?
That's really greate content and presentation,thanks for the hardworking you put on.
I have one request, I was wondering on how we can call any CRUD operation endpoint from the user.component.ts and user.service.ts. it would be much appriciated if you could give me one example on how to implement any CRUD operation enpoint with Token and Role Based Authentication Using JWT.
thanks in advance!!
I have a question please , can we use JWT with oneTOMany relation between User entity and Role entity instead of manytomany ?
ОтветитьHii great video but
public roleMatch(allowedRoles:any): boolean{
let isMatch = false;
const userRoles: any = this.userAuthService.getRoles();
if (userRoles != null && userRoles) {
for (let i = 0; i < userRoles.length; i++) {
for (let j = 0; j < allowedRoles.length; j++) {
if (userRoles[i].roleName === allowedRoles[j]) {
isMatch = true;
return isMatch;
} else {
return isMatch;
}
}
}
}
}
This boolean gives me an error as the return value is unreachable.
Will you please tell me the exact issue?
subscribe is now deprecated what to use now
ОтветитьIam not getting token in ui what to do sir?
ОтветитьJwt Refresh pls 😢
ОтветитьHey, Thanks for the hard work you have done to make this video. It helps me to give a lot of knowledge which I really want to get.
Ответитьthank you for the video. i am new to angular and jwt authorization and yout video is a huge help. i need a CRUD for managing the video. Is there any video that i could add it to this current jwt video? Thanks
Ответитьthanks for this amazing tutorial .
ОтветитьThere's a any possibility that if you deploy this application, somebody can have access to that function of IsMatch, and just put randomly any value like Admin?, if the people is an User for example, like one vulnerability.
ОтветитьHow to create admin role credentials dynamically, not writing manually in the code
Ответитьpublic roleMatch(allowedRoles): boolean , im getting an error Function lacks ending return statement and return type does not include 'undefined'.
Ответитьare u have he source code in git
ОтветитьThis video need more views and it so so simplified. Even though I just dabbled into front end development. THANK YOU!
Ответить