I Built a Game with React (Code Review)
23:46
How I Write Clean Code in React
16:36
The Weirdest Pattern in React
10:12
You Are Using useEffect Wrong
14:40
Welcome to Project React
2:17
2 ай бұрын
Building a Mock API in React
12:26
Introducing Project React
0:47
3 ай бұрын
Converting JSX to TSX in React
9:20
React Router - Complete Tutorial
23:53
React Developer Roadmap 2024
40:08
Zustand - Complete Tutorial
19:27
5 ай бұрын
The problem with useEffect
11:37
5 ай бұрын
Пікірлер
@VidhanReddyDev
@VidhanReddyDev 46 минут бұрын
Thank you very much man it helped a lot - got the complete context ROUTER
@ricohumme4328
@ricohumme4328 Сағат бұрын
I am wondering your decision about choosing HTTP code 403 over 401, which is the actual standard for Unauthorized.
@ahmednasser6877
@ahmednasser6877 3 сағат бұрын
Great tutorial, but I have one question what if the user refreshes the app before the expiration time if so the token in memory will be undefined so how the server will identify the user in the refresh token call ? as the API request token is undefined even if the user has a valid refresh token?
@orcagaming2143
@orcagaming2143 5 сағат бұрын
can you please make a video where you create the server and implement it in the react app I'm having trouble with authentication and authorization
@shubhamchandel-gs4so
@shubhamchandel-gs4so 8 сағат бұрын
okay so here is a question, user refreshes the window and we are sending undifined as the access token , how does the backend know which refresh token to look at? im confused here. when we hit an api we send an access token which is the only way to authenticate the user, but if we are sending undefined then how is there backend checking which refresh token to this user with undifened as access token? Can anyone please explain?
@chrishanthacosta4093
@chrishanthacosta4093 8 сағат бұрын
good explanation bro..
@danilomperson
@danilomperson 10 сағат бұрын
Thank you so much for your videos, they are very well made and very helpful! thanks for what you are doing!
@akashpadampalle2244
@akashpadampalle2244 11 сағат бұрын
i was waiting for this video
@Earth_Elegance_
@Earth_Elegance_ 11 сағат бұрын
Thank you very much for sharing your experience. This gave me a confidence.
@Dabayare
@Dabayare 12 сағат бұрын
You are good n unique as online instructor. Most ppl don't explain the road ahead as you do. They just jump to launching IDEs.
@moatazali1462
@moatazali1462 15 сағат бұрын
Although I've only been following you for a short time, I find what you do amazing. I love the way you explain things so clearly. You are truly great. Thank you!
@trentcox9239
@trentcox9239 18 сағат бұрын
how would this cater to multiple components failing at the same time? wouldn't you need a queue of some description with the first to error being responsible for the refresh then release the queue when the refresh is done? otherwise you risk a cascade of refresh requests for 'n' components on the page (think dashboard)
@__shubhamtiwari
@__shubhamtiwari 19 сағат бұрын
Hey brother, can you give both files where you have written axios logic and this as well, this would be very helpful if you do so. Thankyou 🙏
@andy0401ify
@andy0401ify 20 сағат бұрын
amazing
@goljivines7356
@goljivines7356 21 сағат бұрын
Very nice and concise tutorial. However, can you answer my question ?. Should I do authentication myself or use a third party for that ? Also what are the possible vulnerabilities i am exposed to if i do it myself ?
@user-dd7kw3ym5i
@user-dd7kw3ym5i 22 сағат бұрын
when you store token in in-memory (state or variable) it will be gone when you refresh right?
@gihanrangana6248
@gihanrangana6248 23 сағат бұрын
Nice tutorial, everyone can understand if you create a new video with step-by-step guide from scratch with a demo
@MarlonEnglemam
@MarlonEnglemam Күн бұрын
What happens, in this case, if you refresh the page? I may have missed something but it was not clear to me how to handle that scenario since we're keeping the token only in memory. How should I go about that? I cant just force the user to log back in every time they refresh the page. This is where videos like this always seem to fail to explain... :(
@user-dd7kw3ym5i
@user-dd7kw3ym5i 21 сағат бұрын
that's what comes to my mind too, on page refresh the states or variable will be gone
@rockyGonnaHurtYou
@rockyGonnaHurtYou Күн бұрын
Don't waste your time asking him for the code. He does this on purpose to upsell. Assume he's trying to make money off you every time he fails to leave a code snippet or source code.
@olegsirbu2
@olegsirbu2 Күн бұрын
awesome video tutorial!
@vandermonke4178
@vandermonke4178 Күн бұрын
Would be great if you push the code at the start of the video to a different branch and the end product to the master branch so we could code along
@lyrical6852
@lyrical6852 Күн бұрын
Goodluck on nba finals luka!
@richardhaughton9633
@richardhaughton9633 Күн бұрын
where is the api.fetch('url') comes from?
@hishamch9036
@hishamch9036 Күн бұрын
Thanks you, its a great tutorial.👍
@naveenjain417
@naveenjain417 Күн бұрын
is storing the token in local storage or session storage that bad? i mean i can get the tokens from anywhere even though its in memory every api call will have this data, the attacker can easily add a js interceptor and get this header, so just keeping it in memory doesn't actually solve the issue, and also once the page is refreshed and we are passing undefined for token to the server how is it able to validate the http only cookie, how does it identify if its the same user, can you give some clarity on it?
@Earth_Elegance_
@Earth_Elegance_ Күн бұрын
Yes.. I also feel that the best way to become a senior developer. Thank you brother
@TomislavKimovski
@TomislavKimovski Күн бұрын
The HTTPOnly cookies travel back and forth with every HTTP request and response, just like regular cookies. The only difference is that the browser will not allow the client-side Javascript to access them, which can prevent certain types of attacks.
@hqasmei
@hqasmei Күн бұрын
Great video! Question, for a delete form you'd have to create a different form right?
@ronaldos3738
@ronaldos3738 Күн бұрын
Great job dude, new subs, thanks for the knowledge
@syuo5051
@syuo5051 Күн бұрын
Many thanks for this clear explanation. 💗💗
@brawnie3969
@brawnie3969 Күн бұрын
thanks for the video.
@alukoolakunlesam6874
@alukoolakunlesam6874 Күн бұрын
good video... please, Can we have the code ??
@ayaanshaikh8254
@ayaanshaikh8254 Күн бұрын
But it doesn't really makes sense to me to implement a refresh token? Can't we just send a long lived access token in a http only cookie? Is this approach appropriate?
@MrLOPIU22
@MrLOPIU22 Күн бұрын
One thing that dont make sense to me, if I want to keep the user logged in between refreshes and the access token is kept in memory, how the backend would know which refresh token to check if its valid? I assume that in this case you keep the user id or email in localStorage or some sort, if so, all this trip to secure the authentication it's throw in the trash can.
@MarlonEnglemam
@MarlonEnglemam Күн бұрын
I have the same question! Everywhere I look I see the same explanation but not a direct answer! If it’s in memory it should mean that refreshing the page will lead to losing the access token lol how are we supposed to keep the user logged in??? 😢
@PaperKrane
@PaperKrane 20 сағат бұрын
@@MarlonEnglemam Honestly, I was noticing the same thing. Of course memory will be 'safer' but I don't believe he designed this video with user-experience in mind. From my experience, saving a token to an HTTP-only cookie is safe as well. If you are worried about a token being 'leaked' then I would consider using another method of authentication/authorization simply because in order to save the token to memory, the token would have to be readable and therefore sent from the server which makes it just as prone to being leaked as if you save it in an HTTP-only cookie.
Күн бұрын
if refresh token is enough for authenticate why i must use access token?
@chandruts.2579
@chandruts.2579 Күн бұрын
Nice content
@Unlimited_Codes
@Unlimited_Codes 2 күн бұрын
i will use mix of them or moduler file structures
@gdies1
@gdies1 2 күн бұрын
JWTs are not encrypted but encoded. You can encrypted though in case you want to ensure confidentiality
@mocastello9253
@mocastello9253 2 күн бұрын
once again a very great and well-explained video like always !! a BIG THANKS from berlin 🖤 all respect for your whole effort producing those video tutorials!
@amanjha3346
@amanjha3346 2 күн бұрын
Hy it's looks awesome..and code setup is also excellent can you share the repo link of code.
@legend_749
@legend_749 2 күн бұрын
Please provide the source code
@chai519
@chai519 2 күн бұрын
Will there be a tutorial for Redux toolkit?
@bradleyandrewercole6349
@bradleyandrewercole6349 Күн бұрын
Heyy! Try zustand tho 🎉 it's easier and have less boilerplate
@mobile_genshin
@mobile_genshin 2 күн бұрын
Thank you very much for the video! I have a question, if anyone can answer I'd be very grateful! So this this kind of authorisation implemented in the backend, how should it work in the following example: I have an app where to display the UI correctly I have to make an api call to the backend and fetch some data. This data then used for the UI rendering and it can be visible to any website user, including just unreguistered visitors. They should be able to see the data, but not change it. In this case, how should I make an api call, if there isn't any users (uless you count frontend as a user), but the backend is protected like in the video? Obviously I can't include login/password into an api call for safety reasons, but I also don't have a token to access the data I need. Is this something that backend should care about and provide me a valid token?
@naveenjain417
@naveenjain417 Күн бұрын
Hey, for this case i think you would have to bypass the authorization for those particular API's , typically they will be get only api to give you the info to render it on the UI, and all other backend routes will be going through the authorization so they will be protected.
@bothorsen4292
@bothorsen4292 2 күн бұрын
Thank you for this, it's exactly what I just built for an application. Yay us :D One long note is about the refresh token: You need a way in the server to invalidate users, so even though they have a valid refresh token, they can not get a new access token. The similar but not as important usecase is for changing permissions of a user. I just revalidate the user completely every time, which works because I don't have a very high load on the system. So in this case you don't really need a jwt, as we go to the database every time anyway. My refresh tokens are just random strings. The other way - I assume you would always do this for higher loads? - is to add some way to mark refresh tokens as invalid, which means you need to store them somewhere. So when you want to exclude a user or just changes the permissions, then the refresh token won't automatically work and the full login process is needed again. I would really like to see a follow up video to describe what you do and whether you change this based on the application. This was a great video though. There are an absurd amount of videos out there that tell you to just store the refresh and access tokens in local storage or in some other insecure way. This is only the second time I've seen someone really go through the process the way I also think is the right one.
@simarbaggac-2025
@simarbaggac-2025 2 күн бұрын
Pinia is so simple compared to Redux!
@RyuQ
@RyuQ 2 күн бұрын
a: *Asks question* b: I have never used this so actually I'm not sure... I don't know a: That's a valid answer
@dmitriyskachko9696
@dmitriyskachko9696 2 күн бұрын
This is huge, thank you a lot
@kassihassan
@kassihassan 2 күн бұрын
you earned my subscribe (Y)
@ubarjaktarev
@ubarjaktarev 2 күн бұрын
If you're using this approach (which I don't necessarily have a problem with), pray to God that whoever is doing the backend knows how to manage http-only refresh cookies, CORS etc. otherwise you'll get blamed for users getting logged out all the time with no means of fixing this yourself.
@brandonyippp
@brandonyippp 2 күн бұрын
Seriously underrated channel, thank you so much for your continuous content!