"use strict";
/* API endpoint to determine whether or not the currently authenticated
user has a passport. */
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 has_password_1 = __importDefault(require("@cocalc/server/auth/has-password"));
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");
        }
        res.json({ hasPassword: await (0, has_password_1.default)(account_id) });
    }
    catch (err) {
        res.json({ error: err.message });
    }
}
exports.default = handle;
//# sourceMappingURL=has-password.js.map