CodeIgniter Forums
Detect redirect - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: Detect redirect (/showthread.php?tid=75012)

Detect redirect - XTAZ - 12-07-2019


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 ?

RE: Detect redirect - MGatner - 12-08-2019

You want to check “if $result instanceof RedirectResponse”


CodeIgniter\HTTP\RedirectResponse is the full namespaced version

RE: Detect redirect - ProfessionalCoder - 12-12-2019


you should check session ?