@cocalc/hub
Version:
CoCalc: Backend webserver component
21 lines • 901 B
JavaScript
;
/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.get_passports = exports.have_active_registration_tokens = void 0;
const async_utils_1 = require("@cocalc/util/async-utils");
async function have_active_registration_tokens(db) {
const resp = await (0, async_utils_1.callback2)(db._query, {
query: "SELECT EXISTS(SELECT 1 FROM registration_tokens WHERE disabled IS NOT true) AS have_tokens",
cache: true,
});
return resp.rows[0]?.have_tokens === true;
}
exports.have_active_registration_tokens = have_active_registration_tokens;
async function get_passports(db) {
return await db.get_all_passport_settings_cached();
}
exports.get_passports = get_passports;
//# sourceMappingURL=utils.js.map