Role based Access to Different Pages using REACT and Express Framework (MERN Stack)

Veröffentlicht am: 17 August 2022
auf dem Kanal: Dewmith Akalanka
4,154
75

Get the full source code - https://github.com/dewMyth/mern-learning [branch : role-based-access ]

Hi, in this video I briefly presented how to use "useNavigate()" in react-router-dom library to redirect different pages after a successful login.
For the implementation process I have created my backend using express framework along with a MongoDB database. Nothing too advanced. Just straight to the point in API.
Drop a comment if you need any clarification!

Thank you for watching! ❤️

Timecodes
00:00 - Creating the Express Server
00:24 - The User Model (MongooseSchema)
00:41 - The User Route/Middleware functions
02:02 - Create React App
02:58 - Handling the onClick login button function
03:51 - Installing necessary NPM libraries(axios/react-router-dom)
06:00 - Calling the Login API
07:24 - creating navigate object from useNavigate
08:17 - Conditional Statement to redirect on role base/account type
09:16 - Refactoring the code to meaningful components
10:54 - Wrapping the routes with BrowserRouter and Routes
11:55 - Testing the functionality

#MERN #role_based_access
#redirect_to_different_pages
#useNavigate #express #mongodb #react #reacthooks
#one_login #two_pages_redirect


Auf dieser Seite können Sie das Online-Video Role based Access to Different Pages using REACT and Express Framework (MERN Stack) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Dewmith Akalanka 17 August 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 4,154 Mal angesehen und es wurde von 75 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!