public function post(Request $request)
    {
        $id    = $request->attributes->get('id');
        $token = Arr::get($this->getContentAsArray($request), 'token');

        if (! $token) {
            return $this->createSimpleResponse(422, 'Token not specified.');
        }

        $conditions = [
            'user_id'       => $id,
            'token'         => $token,
            'token_type_id' => TokenEntity::TYPE_VERIFY_REGISTRATION,
        ];

        $token = $this->userService->findTokenBy($conditions);

        if (! $token) {
            return $this->createNotFoundResponse();
        }

        try {
            $user = $this->userService->verifyRegistration($token);
        } catch (OutOfBoundsException $e) {
            $httpCodes = [
                UserService::INCORRECT_TOKEN_TYPE => 422,
                UserService::TOKEN_EXPIRED        => 410,
                UserService::TOKEN_NOT_FOUND      => 404,
            ];

            return $this->createErrorResponse(
                ['token' => ['INVALID']],
                $httpCodes[$e->getCode()]
            );
        }

        $user = $user->getArrayCopy();

        unset($user['password']);

        return $user;
    }