src/Controller/InviteEmployeeController.php
public function acceptAction()
    {
        /* @var $request \Zend\Http\PhpEnvironment\Request */
        $request = $this->getRequest();

        if ($request->isPost()) {
            return $this->createSetPasswordViewModel();
        }

        $token        = $this->params()->fromQuery('token');
        $organization = $this->params()->fromQuery('organization');

        /* @var $handler \Organizations\Controller\Plugin\AcceptInvitationHandler */
        $handler = $this->plugin('Organizations/AcceptInvitationHandler');
        $result  = $handler->process($token, $organization);

        switch ($result) {
            default:
            case AcceptInvitationHandler::OK:
                $model = $this->createSuccessViewModel();
                break;

            case AcceptInvitationHandler::OK_SET_PW:
                $model = $this->createSetPasswordViewModel();
                break;

            case AcceptInvitationHandler::ERROR_ORGANIZATION_NOT_FOUND:
                $model = $this->createErrorViewModel(
                    /*@translate*/ 'The organization referenced in your request could not be found.'
                );
                break;

            case AcceptInvitationHandler::ERROR_TOKEN_INVALID:
                $model = $this->createErrorViewModel(
                    /*@translate*/ 'The access token you provided seems to have expired.'
                );
                break;
        }

        return $model;
    }
public function acceptAction()
    {
        /* @var $request \Zend\Http\PhpEnvironment\Request */
        $request = $this->getRequest();

        if ($request->isPost()) {
            return $this->createSetPasswordViewModel();
        }

        $token        = $this->params()->fromQuery('token');
        $organization = $this->params()->fromQuery('organization');

        /* @var $handler \Organizations\Controller\Plugin\AcceptInvitationHandler */
        $handler = $this->plugin('Organizations/AcceptInvitationHandler');
        $result  = $handler->process($token, $organization);

        switch ($result) {
            default:
            case AcceptInvitationHandler::OK:
                $model = $this->createSuccessViewModel();
                break;

            case AcceptInvitationHandler::OK_SET_PW:
                $model = $this->createSetPasswordViewModel();
                break;

            case AcceptInvitationHandler::ERROR_ORGANIZATION_NOT_FOUND:
                $model = $this->createErrorViewModel(
                    /*@translate*/ 'The organization referenced in your request could not be found.'
                );
                break;

            case AcceptInvitationHandler::ERROR_TOKEN_INVALID:
                $model = $this->createErrorViewModel(
                    /*@translate*/ 'The access token you provided seems to have expired.'
                );
                break;
        }

        return $model;
    }
Invitation second step: Acceptance of the invitation.

@return ViewModel