src/Security/MemberAuthenticator/LoginHandler.php
protected function redirectAfterSuccessfulLogin()
    {
        $this
            ->getRequest()
            ->getSession()
            ->clear('SessionForms.MemberLoginForm.Email')
            ->clear('SessionForms.MemberLoginForm.Remember');

        $member = Security::getCurrentUser();
        if ($member->isPasswordExpired()) {
            return $this->redirectToChangePassword();
        }

        // Absolute redirection URLs may cause spoofing
        $backURL = $this->getBackURL();
        if ($backURL) {
            return $this->redirect($backURL);
        }

        // If a default login dest has been set, redirect to that.
        $defaultLoginDest = Security::config()->get('default_login_dest');
        if ($defaultLoginDest) {
            return $this->redirect($defaultLoginDest);
        }

        // Redirect the user to the page where they came from
        if ($member) {
            // Welcome message
            $message = _t(
                'SilverStripe\\Security\\Member.WELCOMEBACK',
                'Welcome Back, {firstname}',
                ['firstname' => $member->FirstName]
            );
            Security::singleton()->setSessionMessage($message, ValidationResult::TYPE_GOOD);
        }

        // Redirect back
        return $this->redirectBack();
    }
protected function redirectAfterSuccessfulLogin()
    {
        $this
            ->getRequest()
            ->getSession()
            ->clear('SessionForms.MemberLoginForm.Email')
            ->clear('SessionForms.MemberLoginForm.Remember');

        $member = Security::getCurrentUser();
        if ($member->isPasswordExpired()) {
            return $this->redirectToChangePassword();
        }

        // Absolute redirection URLs may cause spoofing
        $backURL = $this->getBackURL();
        if ($backURL) {
            return $this->redirect($backURL);
        }

        // If a default login dest has been set, redirect to that.
        $defaultLoginDest = Security::config()->get('default_login_dest');
        if ($defaultLoginDest) {
            return $this->redirect($defaultLoginDest);
        }

        // Redirect the user to the page where they came from
        if ($member) {
            // Welcome message
            $message = _t(
                'SilverStripe\\Security\\Member.WELCOMEBACK',
                'Welcome Back, {firstname}',
                ['firstname' => $member->FirstName]
            );
            Security::singleton()->setSessionMessage($message, ValidationResult::TYPE_GOOD);
        }

        // Redirect back
        return $this->redirectBack();
    }
protected function redirectAfterSuccessfulLogin ( ) { $ this -> getRequest ( ) -> getSession ( ) -> clear ( 'SessionForms.MemberLoginForm.Email' ) -> clear ( 'SessionForms.MemberLoginForm.Remember' ) ; $ member = Security :: getCurrentUser ( ) ; if ( $ member -> isPasswordExpired ( ) ) { return $ this -> redirectToChangePassword ( ) ; } // Absolute redirection URLs may cause spoofing $ backURL = $ this -> getBackURL ( ) ; if ( $ backURL ) { return $ this -> redirect ( $ backURL ) ; } // If a default login dest has been set, redirect to that. $ defaultLoginDest = Security :: config ( ) -> get ( 'default_login_dest' ) ; if ( $ defaultLoginDest ) { return $ this -> redirect ( $ defaultLoginDest ) ; } // Redirect the user to the page where they came from if ( $ member ) { // Welcome message $ message = _t ( 'SilverStripe\\Security\\Member.WELCOMEBACK' , 'Welcome Back, {firstname}' , [ 'firstname' => $ member -> FirstName ] ) ; Security :: singleton ( ) -> setSessionMessage ( $ message , ValidationResult :: TYPE_GOOD ) ; } // Redirect back return $ this -> redirectBack ( ) ; }
Login in the user and figure out where to redirect the browser.

The $data has this format
array(
'AuthenticationMethod' => 'MemberAuthenticator',
'Email' => 'sam@silverstripe.com',
'Password' => '1nitialPassword',
'BackURL' => 'test/link',
[Optional: 'Remember' => 1 ]
)

@return HTTPResponse
Login in the user and figure out where to redirect the browser .