Winter CMS resources and help articles

Simple and to the point. Optimized by the community.

Redirecting a Backend user after login.

0
by mjauvin, last modified on May 27th, 2023
use Backend; 
use Event;
use Session;

use System\Classes\PluginBase;

class Plugin extends PluginBase
{
    public $elevated = true;

    public function boot()
    {
        Event::listen('backend.user.login', function ($user) {
            if ($user->login === 'myusername') {
                Session::put('url.intended', Backend::url('author/plugin/mycontroller'));
            }
        });
    }
}

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?