Answer the question
In order to leave comments, you need to log in
How to dynamically generate a link to the admin panel?
How to make similar functionality in Symfony?
Every week, the site administration is sent an email with a new link to the admin panel.
I don't understand how to do this.
- created a new link
- sent it to the admins by email
- now how to change all the routes that are in the code?
* @Route(path="???????/")
*/
class AdminAuthController extends Controller
{
/**
* get authentication page
*
* @Route(
* path="????????",
* name="admin.login",
* methods={"GET"},
* )
*/
public function login()
{
return $this->render('common/auth/login.html.twig');
}
Answer the question
In order to leave comments, you need to log in
1) Add the _token variable to the path, Add a RequestListener that checks the token for validity. Add a command that generates a new token and is run by cron before sending mail.
2) Add the _token variable to the path. Specify it in requirements. Add a command that generates a new token and changes it in the config, and then cleans and warms up the cache. Run cron before sending mail.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question