CodeIgniter Forums

Full Version: Detect redirect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

IonAuth controller after user login execute "return redirect()->to('/');" and if fail execute "return redirect()->back()->withInput();".

I in my controllers extends IonAuth controller and I want redirect to /dashboard, if executed "return redirect()->to('/');", and dont touch in other cases.

How I can check this redirect?


PHP Code:
public function login()
{
    
$result parent::login();
    
    
check $result ?

You want to check “if $result instanceof RedirectResponse”

E.g. https://github.com/tattersoftware/codeig...r.php#L132

CodeIgniter\HTTP\RedirectResponse is the full namespaced version
Auth::Check($this->session->has('login')))

you should check session ?