We need to take the token as a parameter from the URL, but we don't know how to do it in the fron-end.
We are working with react-router.
Thi is what users see in the search bar on their browser:
http://localhost:3000/reset-password/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZjI0ODRkZTI5OGNhYTA1YTQwYzAzMTEiLCJpYXQiOjE1OTYyODk2MzcsImV4cCI6MTU5NjI5MDgzN30.bqNDnB63TV7YJMJjOi9B1KqbwA5HsuJ8LSKFoltOdok
This is the request that we have to send to the back-end:
We need help getting a token from URL in React.
We need to take the token as a parameter from the URL, but we don't know how to do it in the fron-end.
We are working with react-router.
Thi is what users see in the search bar on their browser:
http://localhost:3000/reset-password/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZjI0ODRkZTI5OGNhYTA1YTQwYzAzMTEiLCJpYXQiOjE1OTYyODk2MzcsImV4cCI6MTU5NjI5MDgzN30.bqNDnB63TV7YJMJjOi9B1KqbwA5HsuJ8LSKFoltOdok
This is the request that we have to send to the back-end:
await Axios.put('http://localhost:8080/api/reset-password/${token}'
How can we take that token from the URL?.
Our code https://github.com/NickMarinade/lightz/blob/updates/src/Front/components/password/NewPassword.js