React Typescript Context Auth JWT - 37. Protected Routes

  Рет қаралды 1,589

Teddy Smith

Teddy Smith

3 ай бұрын

React Typescript Context Auth JWT - 5. Protected Routes
Github repo: github.com/teddysmithdev/FinS...
Twitter: / teddysmithdev
Github: github.com/teddysmithdev
Linkedin: / teddy-smith-015ba61a3

Пікірлер: 4
@iamabhirupdatta
@iamabhirupdatta 19 күн бұрын
Hey, thanks for this video. 1 suggestion: we can use PropsWithChildren from react, instead of manually typing children:ReactNode.
@anthonyoconnell4575
@anthonyoconnell4575 3 ай бұрын
Hi Teddy,just finished your mvc videos. Great series. Thanks a lot dude! I am having trouble downloading the project from github. I unzipped the file, connected it to my own cloudinary account and sql server. However I am getting an error when I update the database/ add a migration and try to seed the data. Would you mind uploading a video or recommending a video that goes through the necessary steps to run the project. Thank you.
@Prag1974
@Prag1974 Ай бұрын
Something's been on my mind. ProtectedRoute points to the {children} property depending on the boolean value returned by the isLoggedIn function and the isLoggedIn function returns true or false depending on whether the user object (this is a state) exists or not. And we set the user object when the page is rendered in the useEffect hook using the user and token information we get from localStorage. This means that the value returned by the isLoggedIn function is completely dependent on the existence of user and token information in localStorage (This information does not need to be valid, it just needs to exist). So malicious people who normally cannot see these pages can see them just by adding the "user" and "token" information to localStorage. (As I said, this information does not need to be valid. They just need to exist). Isn't this a security flaw? To solve this problem, shouldn't we check if the logged in user token exists in the database? How can we fix this flaw? Pardon me for my English.
@TeddySmithDev
@TeddySmithDev Ай бұрын
I would make "IsAuthenticated" API endpoint on backend and just check it each time they want to access protected resource. Would take 5 mins to build and would be pretty performant and secure.
React Typescript Context Auth JWT - 38. Logout
3:32
Teddy Smith
Рет қаралды 1,2 М.
React Typescript Context Auth JWT - 34. Context
19:40
Teddy Smith
Рет қаралды 2,4 М.
OMG 😨 Era o tênis dela 🤬
00:19
Polar em português
Рет қаралды 11 МЛН
Why? 😭 #shorts by Leisi Crazy
00:16
Leisi Crazy
Рет қаралды 46 МЛН
React Typescript Context Auth JWT - 35. Login
13:02
Teddy Smith
Рет қаралды 2,5 М.
Congratulations, 11-ICT-Programming!
1:39
Francisco Quiaot
Рет қаралды 14
Authentication vs Authorization
1:00
A Binary Code
Рет қаралды 8 М.
React protected routes in 4 minutes
4:03
Appwrite
Рет қаралды 2,2 М.
React Context API with TypeScript | UserContext React TypeScript
14:47
WebDevWithArtisan
Рет қаралды 12 М.
Don’t Use JWT for Login Sessions
1:00
Coding in Flow
Рет қаралды 58 М.
Why I don't use React-Query and tRPC in Next.js
18:58
ByteGrad
Рет қаралды 68 М.
CORRUGATED CARDBOARD KENKENPA!#shorts
0:19
HAYATAKU はやたく
Рет қаралды 7 МЛН
ДЕНЬ РОЖДЕНИЯ БАБУШКИ #shorts
0:19
Паша Осадчий
Рет қаралды 4,3 МЛН