wrapStrategyVerify(pluginName, strategyName, verifyMethod) {
    const prefix = `${pluginName} Strategy ${strategyName}:`;

    return async (...args) => {
      const callback = args[args.length - 1];
      const ret = verifyMethod(...args.slice(0, -1));

      // catching plugins returning non-thenable content
      // @todo - with async/await we might consider allowing non-promise results
      if (!ret || !_.isFunction(ret.then)) {
        callback(strategyError.get("invalid_verify_return", prefix, ret));
        return;
      }

      let result;

      try {
        result = await ret;
      } catch (e) {
        callback(e);
        return;
      }

      if (result === false) {
        callback(null, result, { message: null });
        return;
      }

      if (!isPlainObject(result)) {
        callback(strategyError.get("invalid_verify_resolve", prefix));
        return;
      }

      if (result.kuid !== null && result.kuid !== undefined) {
        if (typeof result.kuid === "string") {
          try {
            const user = await global.kuzzle.ask(
              "core:security:user:get",
              result.kuid,
            );

            callback(null, user);
          } catch (e) {
            if (e.id === "security.user.not_found") {
              callback(strategyError.get("unknown_kuid", prefix));
            } else {
              callback(e);
            }
          }

          return;
        }

        callback(strategyError.get("invalid_kuid", prefix, typeof result.kuid));
        return;
      }

      let message;
      if (result.message && typeof result.message === "string") {
        message = result.message;
      } else {
        message = `Unable to log in using the strategy "${strategyName}"`;
      }

      callback(null, false, { message });
    };
  }
Wraps a strategy plugin's verify function.

@param {String} pluginName
@param {String} strategyName
@param {Function} verifyMethod - Strategy plugin's verify method
@returns {Function}