MCPcopy
hub / github.com/codeaashu/claude-code / clearTrustedDeviceToken

Function clearTrustedDeviceToken

src/bridge/trustedDevice.ts:72–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 * enrollment completion would otherwise still read the old cached token).
71 */
72export function clearTrustedDeviceToken(): void {
73 if (!isGateEnabled()) {
74 return
75 }
76 const secureStorage = getSecureStorage()
77 try {
78 const data = secureStorage.read()
79 if (data?.trustedDeviceToken) {
80 delete data.trustedDeviceToken
81 secureStorage.update(data)
82 }
83 } catch {
84 // Best-effort — don't block login if storage is inaccessible
85 }
86 readStoredToken.cache?.clear?.()
87}
88
89/**
90 * Enroll this device via POST /auth/trusted_devices and persist the token

Callers 1

callFunction · 0.85

Calls 5

isGateEnabledFunction · 0.85
getSecureStorageFunction · 0.85
readMethod · 0.65
updateMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected