const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
const require_utils_responseData = require('../utils/responseData.cjs');
const require_utils_errors_ErrorHandler = require('../utils/errors/ErrorHandler.cjs');
let oauth2_server = require("oauth2-server");

//#region src/controllers/oAuth2.controller.ts
const getOAuth2AccessToken = async (req, res, _next) => {
	const oauthRequest = new oauth2_server.Request(req);
	const oauthResponse = new oauth2_server.Response(res);
	try {
		const responseData = require_utils_responseData.formatResponse({ data: await req.oauth.token(oauthRequest, oauthResponse) });
		res.json(responseData);
		return;
	} catch (error) {
		require_utils_errors_ErrorHandler.ErrorHandler.handleAppErrorResponse(res, error);
		return;
	}
};

//#endregion
exports.getOAuth2AccessToken = getOAuth2AccessToken;
//# sourceMappingURL=oAuth2.controller.cjs.map