"use strict";
(() => {
var exports = {};
exports.id = 908;
exports.ids = [908];
exports.modules = {

/***/ 2167:
/***/ ((module) => {

module.exports = require("axios");

/***/ }),

/***/ 9344:
/***/ ((module) => {

module.exports = require("jsonwebtoken");

/***/ }),

/***/ 2799:
/***/ ((module) => {

module.exports = require("micro-cors");

/***/ }),

/***/ 4558:
/***/ ((module) => {

module.exports = require("next/config");

/***/ }),

/***/ 6555:
/***/ ((module) => {

module.exports = import("uuid");;

/***/ }),

/***/ 7147:
/***/ ((module) => {

module.exports = require("fs");

/***/ }),

/***/ 8213:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _vulcan_sql_catalog_server_utils_authHelper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1000);
/* harmony import */ var _vulcan_sql_catalog_server_utils_errorCode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5373);
/* harmony import */ var micro_cors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2799);
/* harmony import */ var micro_cors__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(micro_cors__WEBPACK_IMPORTED_MODULE_2__);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_vulcan_sql_catalog_server_utils_authHelper__WEBPACK_IMPORTED_MODULE_0__]);
_vulcan_sql_catalog_server_utils_authHelper__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];



const cors = micro_cors__WEBPACK_IMPORTED_MODULE_2__();
const handler = async (req, res)=>{
    const { body: { username , password  } , method ,  } = req;
    if (method === "POST") {
        try {
            const { accessToken , refreshToken , profile  } = await _vulcan_sql_catalog_server_utils_authHelper__WEBPACK_IMPORTED_MODULE_0__/* .authHelper.login */ .$K.login({
                username,
                password
            });
            res.status(200).json({
                accessToken,
                refreshToken,
                profile
            });
        } catch (error) {
            if (error instanceof _vulcan_sql_catalog_server_utils_errorCode__WEBPACK_IMPORTED_MODULE_1__/* .HttpError */ .o) {
                return res.status(error.status).json({
                    code: error.code
                });
            }
            throw error;
        }
    } else {
        res.status(404).end();
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cors(handler));

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ })

};
;

// load runtime
var __webpack_require__ = require("../../../webpack-api-runtime.js");
__webpack_require__.C(exports);
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
var __webpack_exports__ = __webpack_require__.X(0, [216,0], () => (__webpack_exec__(8213)));
module.exports = __webpack_exports__;

})();