public function index()
    {
        //  Validates the request token and generates a new one for the next request
        $this->validateToken();

        // --------------------------------------------------------------------------

        //  Has this user already set up an MFA?
        $oAuthModel = Factory::model('Auth', 'nails/module-auth');
        $oMfaDevice = $oAuthModel->mfaDeviceSecretGet($this->mfaUser->id);

        if ($oMfaDevice) {
            $this->requestCode();
        } else {
            $this->setupDevice();
        }
    }
public function index()
    {
        //  Validates the request token and generates a new one for the next request
        $this->validateToken();

        // --------------------------------------------------------------------------

        //  Has this user already set up an MFA?
        $oAuthModel = Factory::model('Auth', 'nails/module-auth');
        $oMfaDevice = $oAuthModel->mfaDeviceSecretGet($this->mfaUser->id);

        if ($oMfaDevice) {
            $this->requestCode();
        } else {
            $this->setupDevice();
        }
    }
public function index ( ) { //  Validates the request token and generates a new one for the next request $ this -> validateToken ( ) ; // -------------------------------------------------------------------------- //  Has this user already set up an MFA? $ oAuthModel = Factory :: model ( 'Auth' , 'nails/module-auth' ) ; $ oMfaDevice = $ oAuthModel -> mfaDeviceSecretGet ( $ this -> mfaUser -> id ) ; if ( $ oMfaDevice ) { $ this -> requestCode ( ) ; } else { $ this -> setupDevice ( ) ; } }
Remaps requests to the correct method

@throws \Nails\Common\Exception\FactoryException
Remaps requests to the correct method