CakeDC\Users\Controller\Traits\LoginTrait::_afterIdentifyUser PHP Method

_afterIdentifyUser() protected method

Update remember me and determine redirect url after user identified
protected _afterIdentifyUser ( array $user, boolean $socialLogin = false, $googleAuthenticatorLogin = false ) : array
$user array user data after identified
$socialLogin boolean is social login
return array
    protected function _afterIdentifyUser($user, $socialLogin = false, $googleAuthenticatorLogin = false)
    {
        if (!empty($user)) {
            $this->Auth->setUser($user);
            if ($googleAuthenticatorLogin) {
                $url = Configure::read('GoogleAuthenticator.verifyAction');
                return $this->redirect($url);
            }
            $event = $this->dispatchEvent(UsersAuthComponent::EVENT_AFTER_LOGIN, ['user' => $user]);
            if (is_array($event->result)) {
                return $this->redirect($event->result);
            }
            $url = $this->Auth->redirectUrl();
            return $this->redirect($url);
        } else {
            if (!$socialLogin) {
                $message = __d('CakeDC/Users', 'Username or password is incorrect');
                $this->Flash->error($message, 'default', [], 'auth');
            }
            return $this->redirect(Configure::read('Auth.loginAction'));
        }
    }