@cocalc/server
Version:
CoCalc server functionality: functions used by either the hub and the next.js server
10 lines (8 loc) • 322 B
text/typescript
import getPool from "@cocalc/database/pool";
export default async function getRequiresTokens(): Promise<boolean> {
const pool = getPool("long");
const { rows } = await pool.query(
"SELECT EXISTS(SELECT 1 FROM registration_tokens WHERE disabled IS NOT true) AS have_tokens"
);
return !!rows[0]?.have_tokens;
}