B
B
BonBon Slick2018-01-27 12:31:35
symfony
BonBon Slick, 2018-01-27 12:31:35

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');
    }

it will be necessary to rewrite all routes in all controllers as I understand it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-01-27
@BonBonSlick

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 question

Ask a Question

731 491 924 answers to any question