MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / blockUser

Function blockUser

apps/web/src/lib/user/block.ts:27–40  ·  view source on GitHub ↗
(params: BlockUserParams)

Source from the content-addressed store, hash-verified

25 * Also in the same transaction, through `revokeUserSessions`: revokes step-up
26 * proofs, denies pending or approved device auth requests, revokes device
27 * sessions with their unconsumed refresh tokens, deletes native attested keys,
28 * and deletes unconsumed app-shell hand-off tokens.
29 *
30 * @returns `true` if this call transitioned the user from unblocked to blocked,
31 * `false` if the user was already blocked (or does not exist).
32 */
33export async function blockUser(params: BlockUserParams): Promise<boolean> {
34 const executor = params.dbOrTx;
35
36 async function run(tx: typeof db | DrizzleTransaction): Promise<boolean> {
37 const rows = await tx
38 .update(kilocode_users)
39 .set({
40 blocked_reason: params.reason,
41 blocked_at: new Date().toISOString(),
42 blocked_by_kilo_user_id: params.blockedByKiloUserId ?? null,
43 api_token_pepper: randomUUID(),

Callers 6

saveFingerprintsFunction · 0.90
block.test.tsFile · 0.90
admin-router.tsFile · 0.90

Calls 2

setMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected