"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.auth = void 0;

var _shopify = require("../helpers/shopify");

var _utils = require("../helpers/utils");

const auth = async (req, res, config) => (0, _utils.handler)(_utils.hasShop, async data => {
  const url = (0, _shopify.getShopifyAuthUrl)(config, data.body.shop);
  console.log(`Redirecting to ${url}`);
  res.status(200).json({
    status: "success",
    body: url
  });
})(req, res, config);

exports.auth = auth;
//# sourceMappingURL=auth.js.map