lonnieezell / myth-auth

One-stop Auth package for CodeIgniter 4
MIT License
634 stars 207 forks source link

Handling query string for redirectUrl in filters #450

Closed Eeel-12 closed 2 years ago

Eeel-12 commented 3 years ago

Hi,

what do you think of adding to filters redirectUrl support for query string ? Like ?page=2&per_page=50

           if (! $authenticate->check())
    {
        $redirectURL = ($queryString = service('uri')->getQuery())
            ? current_url().'?'.$queryString
            : current_url();

        session()->set('redirect_url', $redirectURL);
        return redirect('login');
    }
mjamilasfihani commented 3 years ago

In my case, I set redirection again at '/' controller. It will redirect to dashboard page, but I also keep the session message. So I will not lost it. Anyway you can modify the filter as you need :)