"use strict";
/*
Delete the account that the user is currently signed in using.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const get_account_1 = __importDefault(require("lib/account/get-account"));
const delete_1 = __importDefault(require("@cocalc/server/accounts/delete"));
async function handle(req, res) {
    try {
        const account_id = await (0, get_account_1.default)(req);
        if (!account_id) {
            throw Error("must be signed in");
        }
        await (0, delete_1.default)(account_id);
        res.json({});
    }
    catch (err) {
        res.json({ error: err.message });
    }
}
exports.default = handle;
//# sourceMappingURL=delete.js.map