src/Handlers/BootstrapMFALoginHandler.php
public function secondFactor(HTTPRequest $request)
    {
        $memberID = $request->getSession()->get(BootstrapMFAAuthenticator::SESSION_KEY . '.MemberID');
        /** @var Member|MemberExtension $member */
        $member = Member::get()->byID($memberID);

        if (!$member) {
            // Assume the session has gone state...
            return $this->redirectBack();
        }

        $primary = $member->PrimaryMFA;
        $formList = $this->getFormList();

        $view = ArrayData::create(['Forms' => ArrayList::create($formList)]);
        $rendered = [
            'Forms'   => $formList,
            'Form'    => $view->renderWith(self::class . '_MFAForms'),
            'Primary' => $primary
        ];

        $this->extend('onBeforeSecondFactor', $rendered, $view);

        return $rendered;
    }
public function secondFactor(HTTPRequest $request)
    {
        $memberID = $request->getSession()->get(BootstrapMFAAuthenticator::SESSION_KEY . '.MemberID');
        /** @var Member|MemberExtension $member */
        $member = Member::get()->byID($memberID);

        if (!$member) {
            // Assume the session has gone state...
            return $this->redirectBack();
        }

        $primary = $member->PrimaryMFA;
        $formList = $this->getFormList();

        $view = ArrayData::create(['Forms' => ArrayList::create($formList)]);
        $rendered = [
            'Forms'   => $formList,
            'Form'    => $view->renderWith(self::class . '_MFAForms'),
            'Primary' => $primary
        ];

        $this->extend('onBeforeSecondFactor', $rendered, $view);

        return $rendered;
    }
public function secondFactor ( HTTPRequest $ request ) { $ memberID = $ request -> getSession ( ) -> get ( BootstrapMFAAuthenticator :: SESSION_KEY . '.MemberID' ) ; /** @var Member|MemberExtension $member */ $ member = Member :: get ( ) -> byID ( $ memberID ) ; if ( ! $ member ) { // Assume the session has gone state... return $ this -> redirectBack ( ) ; } $ primary = $ member -> PrimaryMFA ; $ formList = $ this -> getFormList ( ) ; $ view = ArrayData :: create ( [ 'Forms' => ArrayList :: create ( $ formList ) ] ) ; $ rendered = [ 'Forms' => $ formList , 'Form' => $ view -> renderWith ( self :: class . '_MFAForms' ) , 'Primary' => $ primary ] ; $ this -> extend ( 'onBeforeSecondFactor' , $ rendered , $ view ) ; return $ rendered ; }
Render the second factor forms for displaying at the frontend

@param HTTPRequest $request
@return array
@throws \Exception
Render the second factor forms for displaying at the frontend