I need to generate a unique link so that when the user clicks through it, it will appear on a certain page. However, the user cannot directly navigate through it if he simply drives in the URL address in the address bar.

Why do you need it? For example, beta access to some site. The user sends a request, the admin sends him a unique link to the mail, clicking on which, the user is on the registration page.

As far as I understand, it is necessary to generate some kind of token, pass it to the link itself as a parameter, and then do the check in the component.

But how to implement it in the second Angular? In particular, how to transfer a token as a parameter?

  • Follow the link from the mail is no different from typing the URL in the address bar - vp_arth
  • @vp_arth And what if if the link cannot be invented and it contains random characters? For example, like example.com/4273864832764832764832 ? In this case, access to the link will be available only to special users. - Billy Logan
  • Add the code to the question how you generate the link without a token. Usually this, like sending a letter, is the server. - vp_arth
  • @vp_arth I agree that this is the server’s work, but I’ve got it in such a way that the client side shows pages and requests are simply sent to the API. - Billy Logan
  • @vp_arth is good. Imagine that I generated a link on the server and sent an email with it. Then the question is how to check the correct token on the client if it was initially generated on the server - Billy Logan

0