MERN Authentication Tutorial #16 - Protecting React Routes

MERN Authentication Tutorial #16 - Protecting React Routes

Net Ninja

1 год назад

26,081 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Camakarzie
Camakarzie - 27.07.2023 09:49

Awesome course again, but I am stumped on this one when it comes to passing the user to the routes. I have updated my react router to v6 with createBrowserRouter. I was wondering how do I go about passing the { user } to that?

Ответить
Donia El Fouly
Donia El Fouly - 08.05.2023 23:28

thanks

Ответить
Dwight lindquist
Dwight lindquist - 27.02.2023 17:06

I am doing the element={user ? <Workout /> : <Navigate to="/login" />}, but am being re-directed to the login page even if I know there is a user in state. I am console.logging user Auth context, and it logs as null twice then with the correct current user data twice. So, on initial check, it thinks that there is no user and re-routes to /login. How do I fix this?

Ответить
Shinoy
Shinoy - 30.01.2023 12:36

I want to hide the navbar in login screen,

can Anyone help me please?

Ответить
zakaria balaari
zakaria balaari - 30.01.2023 01:58

THANK YOU SIR , GREAT LESSON

Ответить
FellTheSky
FellTheSky - 28.01.2023 01:32

Is this the only way? I mean I have 40 routes. Do I have to validate in each one if there is a user logged in?

Ответить
Islam
Islam - 23.01.2023 08:22

Ответить
mohamed youssef
mohamed youssef - 13.01.2023 01:21

Awesome video +++++++++++++++++++ 🙂

Ответить
lifestyle nounou
lifestyle nounou - 29.11.2022 12:18

THE BEST

Ответить
Michal Nowak
Michal Nowak - 15.10.2022 17:56

thx

Ответить
Solo Mormex
Solo Mormex - 02.10.2022 15:07

After this step whenever I'm refreshing any other page it is
always taking me back to homepage. How to solve this?

Ответить
shareCodeCamp
shareCodeCamp - 09.08.2022 10:39

best 🔥

Ответить
Dixon Souaré
Dixon Souaré - 09.08.2022 00:23

Hey gang are you going to do the forgot password video?

Ответить
programming dude
programming dude - 08.08.2022 23:04

my searching your discord community for help but didn’t get

Ответить
John Margotti
John Margotti - 08.08.2022 23:03

This was a great tutorial. Can you consider adding a search page lesson. Like I only want to show workouts with 10 reps or workouts with setups etc etc ability to search and filter on any field ?

Ответить
Aaron Moreno
Aaron Moreno - 08.08.2022 16:46

Funny enough, that little margin was bugging me too. lol. Thank you for these Shaun! You're seriously top 3 best teachers

Ответить
Somnath Das
Somnath Das - 08.08.2022 13:17

Thank you..♥️❤️❤️♥️

Ответить
Mask Man
Mask Man - 08.08.2022 13:05

Why not doing like this: <Route path="/login" elementt={ ?user ? <Login /> : <Home/> } ? 🙄

Ответить
Dario Basset
Dario Basset - 08.08.2022 11:27

Gooosh. You're tireless. Even in August you work like a stream.

Ответить
Max Just Max
Max Just Max - 08.08.2022 11:14

straight forward and into the point I love your style thanks a lot

Ответить
aslam khan
aslam khan - 08.08.2022 11:08

How much time it will take you to complete this project basically asking how much videos are left?

Ответить
Monster
Monster - 08.08.2022 10:56

Has any of your work been compromised by the increased number of hackers?

Ответить
Isaac Qadri
Isaac Qadri - 08.08.2022 10:30

i was practicing while waiting for this 🔥🔥😍😍

Ответить