R
R
Ruslan2020-12-07 17:24:17
Nginx
Ruslan, 2020-12-07 17:24:17

How to implement user activation via email in React and Nginx?

My question:
When a user registers on my site, he receives a link to activate his account by email from the back. The user must click on this link to activate.
How can a react application catch this link after clicking on it in the mail to make a back request?

There is a route in react:

<Route path="/activate/:id1/:id2" component={UserActivationContainer} />


A link with two parameters (route parameters not query parameters).

As I understand it, I need to register something on nginx so that it gives the user my application. How to do it?
The nginx config has this line:
try_files $uri $uri/ /index.html;
but it does not help in the case of route parameters.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-12-07
@Rus17

Why does a react application need to catch this link? The backend should process this request and redirect the user to the correct url

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question