Handle login form

Hello everyone, I’m a newbie in the front end development, now i’m study how to handle the logins form and I have 2 problem:
1)After I send the request for login I have in response.data.role the role of user but I don’t understand how to save it correctly in the state.
2)How to redirect if the user role is correctly to home page(private route).
I attach screens bellow.
Thanks all ! 👏
Captura_de_ecran_din_2023-12-08_la_10.21.19.png
Captura_de_ecran_din_2023-12-08_la_10.20.50.png
Captura_de_ecran_din_2023-12-08_la_10.21.04.png
Was this page helpful?