Welcome Guest, Not a member yet? Register   Sign In
Detect redirect
#1

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 ?

Reply
#2

(This post was last modified: 12-08-2019, 08:05 AM by MGatner.)

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
Reply
#3

(This post was last modified: 12-12-2019, 02:50 AM by ProfessionalCoder.)

Auth::Check($this->session->has('login')))

you should check session ?
Sercan YANBULOGLU
SEO links REDACTED, per forum policy
Reply




Theme © iAndrew 2016 - Forum software by © MyBB