Welcome Guest, Not a member yet? Register   Sign In
Shield problem redirecting in hosting
#4

(06-13-2025, 07:07 PM)luckmoshy Wrote: inspect your permission and user group. Lever shield: use these



I don't tink it's a permission problem ,

this is method in config/auth

Code:
    public function loginRedirect(): string
    {
        $session = session();
        $url    = $session->getTempdata('beforeLoginUrl') ?? setting('Auth.redirects')['login'];



        if (auth()->user()->can('admin.access')) {

            //log_message('info', 'permission:admin.access');

            $url = '/admin/dashboard';

            return $this->getUrl($url);

        } elseif (auth()->user()->can('user.access')) {

            //log_message('info', 'permission:agente.access');

            $url = '/user/dashboard';

            return $this->getUrl($url);
        }
       
        return $this->getUrl($url);
    }

and this is route :

Code:
$routes->group('admin', ['filter' => 'permission:admin.access', 'namespace' => 'App\Controllers\Admin'], function ($routes) {

    $routes->get('dashboard', 'Admin::dashboard');
});

in db i have two user 1 superadmin 1 admin

i try to remove  'filter' => 'permission:admin.access',  but it redirect always on login
Reply


Messages In This Thread
RE: Shield problem redirecting in hosting - by pippuccio76 - 06-14-2025, 12:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB