Implement User Login through an API call using React and Redux Toolkit
Вставка
- Опубліковано 5 тра 2023
- In this tutorial, learn how to implement user login through an API call using React and Redux Toolkit.
If you want to learn about how to persist user login in redux toolkit with redux persist then watch my below tutorial
Redux Persist Tutorial: • Redux Persistent User ...
If you want to support me with a donation🎁
Buy me a coffee: www.buymeacoffee.com/anwarhamzat
If you have any issues you can contact me:
LinkedIn: / hamza-anwar75
Instagram: / humzaanwar74
For paid projects, contact me
Email: anwarhamza919@gmail.com
Fiverr: www.fiverr.com/hamzawebdev75
Upwork: www.upwork.com/freelancers/~0...
Special discounts for students who are looking for paid courses to better elevate their skill level
GET Rs 5000 discount on Azad Chaiwala Php Web Development Course
azadchaiwala.com/course/web-d...
GET Rs 6000 discount on Azad Chaiwala Mobile App Development Course
azadchaiwala.com/course/app-d...
GET Rs 5000 discount on Azad Chaiwala Python Programming Course
azadchaiwala.com/course/pytho...
Music used in this video
1- Fragments by AERØHEAD
Fragments by AERØHEAD | / aerohead
Music promoted by www.free-stock-music.com
Creative Commons / Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
creativecommons.org/licenses/...
2- Lifting Dreams (UA-cam Audio Library)
3- Dreamland (UA-cam Audio Library)
Thanks! Your video helped me a lot.
Thank You so much... I was looking for this kind of video only.... Very Usefull
Great and easy way to understand without voice 😆
Great video bro.. I have used DRF for backend and next js (frontend).. Used custom authentication and login with redux is integrated! Thank you so much! It took me 2-3 days to Integrate for my own project and found this video very helpful..
very useful
Very helpful
Great video, help me a lot!
awesome
Great work....please provide sorce code link too
Great, thanks
is putting all the user data in the localStorage safe ?
Great, thanks, dude. May I ask you a question, is necessary react-readux? I mean, is not redux-toolkit enough?
React-redux connects react with redux store, useDispatch and useSelectors are from the react-redux package
Hi) Thnx for tutorial )What does "user/loginUser' in the 6 row of UserSlice mean?
It is just a string to identify what functionality we are working on. You can name it anything for your ease
@@JSSolutions thank you for quick reply) So, I assume that I can't find this literal anywhere in the rest of code, and it's just for my convenience?
why do you have to add e.preventDefault(); in handle Login event ? - I'm trying to code the same and remove it, but it make a bug that I can't navigate to Home page !
By the way it still help me alot , great video !
To prevent the default refresh behaviour of form when you submit
@@JSSolutions thanks ! I got it
why react thunk if i can login user from component and set user into localstorage
You can use components but if u need to separate auth logic then use redux async thunk
Where you kepted your credentials like email and password ?
No need to save password, just user object which contains email in local storage
what about hostName in config js?
replace that with yours or you can directly use your host name
How to replace it, please show me@@shahidx0x
Hey , i have a small doubt...After getting token ,where should i store it?
Local storage or cookies, you can also try redux persist
Hostname and token included in config .js isn't it?
@JSSolutions Is there any vedio uploaded by you related to it its token authentication ?
When the website is refreshed after logging in, will the data be lost or will it remain?
It will remain there because I am getting it from Local storage
@@JSSolutions I am confusing is it necessary to store user data into local storage ?
and we are posting data to the backend Api so we should store it also as you store it in local storage
pls share the code sir
mine is not centered like this
Give width to your form, for example 500px then use margin auto to center the box
can you please provide source code
sir.. what is the need for local storage then?you can get the data from the backend only
To persist the user token and use it in other API calls where required
@@JSSolutions bro you must be the biggest idiot on the planet why even use global state when you are just using localStorage to conditionally render the components ?