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

Function denyDeviceAuthRequest

apps/web/src/lib/device-auth/device-auth.ts:129–144  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

127}): boolean {
128 return new Date(request.expires_at) < new Date() || request.status === 'expired';
129}
130
131/**
132 * Approve a device authorization request.
133 */
134export async function approveDeviceAuthRequest(code: string, userId: string): Promise<void> {
135 const now = new Date().toISOString();
136 const [approved] = await db
137 .update(device_auth_requests)
138 .set({
139 status: 'approved',
140 kilo_user_id: userId,
141 approved_at: now,
142 })
143 .where(
144 and(
145 eq(device_auth_requests.code, code),
146 eq(device_auth_requests.status, 'pending'),
147 gt(device_auth_requests.expires_at, now)

Callers 2

DELETEFunction · 0.90

Calls 3

getDeviceAuthRequestFunction · 0.85
setMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected