I am working on a custom Drupal 8 module that has its own authentication form.
For this, I created a Drupal page with the custom authentication form, i.e. I have a route at
What I am not able to figure out is how can I replace Drupal's default Register and Login links which are scattered everywhere on the website to point to above route. I don't want to redirect from
/user/login page to
/custom-signup as I still want to allow admin to login. For all other users except admins should be redirected to
I could use jquery to brute-force my way to replace the links, but is there an efficient way to achieve this?
TL;DR: I need to replace following default Drupal links using my module.
Following the first solution, I added the routing files as follows, the links are redirecting me to my custom form.