library/Garp/Auth/Adapter/Passwordless.php
public function requestToken(array $userData) {
        if (empty($userData['email'])) {
            $this->_addError(
                sprintf(
                    __('%s is a required field'),
                    __('Email')
                )
            );
            return false;
        }

        $validator = new Zend_Validate_EmailAddress();
        if (!$validator->isValid($userData['email'])) {
            $this->_addError(
                sprintf(
                    __('%s is not a valid email address'),
                    __('Email')
                )
            );
            return false;
        }

        $userId = $this->_createOrFetchUserRecord($userData);
        $token  = $this->createOrUpdateAuthRecord($userId);

        $this->_sendTokenEmail($userData['email'], $userId, $token);
        $this->setRedirect($this->_getRedirectUrl());
    }
public function requestToken(array $userData) {
        if (empty($userData['email'])) {
            $this->_addError(
                sprintf(
                    __('%s is a required field'),
                    __('Email')
                )
            );
            return false;
        }

        $validator = new Zend_Validate_EmailAddress();
        if (!$validator->isValid($userData['email'])) {
            $this->_addError(
                sprintf(
                    __('%s is not a valid email address'),
                    __('Email')
                )
            );
            return false;
        }

        $userId = $this->_createOrFetchUserRecord($userData);
        $token  = $this->createOrUpdateAuthRecord($userId);

        $this->_sendTokenEmail($userData['email'], $userId, $token);
        $this->setRedirect($this->_getRedirectUrl());
    }
public function requestToken ( array $ userData ) { if ( empty ( $ userData [ 'email' ] ) ) { $ this -> _addError ( sprintf ( __ ( '%s is a required field' ) , __ ( 'Email' ) ) ) ; return false ; } $ validator = new Zend_Validate_EmailAddress ( ) ; if ( ! $ validator -> isValid ( $ userData [ 'email' ] ) ) { $ this -> _addError ( sprintf ( __ ( '%s is not a valid email address' ) , __ ( 'Email' ) ) ) ; return false ; } $ userId = $ this -> _createOrFetchUserRecord ( $ userData ) ; $ token = $ this -> createOrUpdateAuthRecord ( $ userId ) ; $ this -> _sendTokenEmail ( $ userData [ 'email' ] , $ userId , $ token ) ; $ this -> setRedirect ( $ this -> _getRedirectUrl ( ) ) ; }
Request a new token

@param array $userData
@return void
@todo Allow different delivery-methods, such as SMS?
Request a new token