MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / setZooCodeUserInfo

Function setZooCodeUserInfo

src/services/zoo-code-auth.ts:110–140  ·  view source on GitHub ↗
(info: {
	name?: string | null
	email?: string | null
	image?: string | null
})

Source from the content-addressed store, hash-verified

108}
109
110export async function setZooCodeUserInfo(info: {
111 name?: string | null
112 email?: string | null
113 image?: string | null
114}): Promise<void> {
115 if (!secretStorage) return
116
117 if (info.name) {
118 await secretStorage.store(ZOO_CODE_USER_NAME_KEY, info.name)
119 _cachedUserName = info.name
120 } else if (info.name === null) {
121 await secretStorage.delete(ZOO_CODE_USER_NAME_KEY)
122 _cachedUserName = undefined
123 }
124
125 if (info.email) {
126 await secretStorage.store(ZOO_CODE_USER_EMAIL_KEY, info.email)
127 _cachedUserEmail = info.email
128 } else if (info.email === null) {
129 await secretStorage.delete(ZOO_CODE_USER_EMAIL_KEY)
130 _cachedUserEmail = undefined
131 }
132
133 if (info.image) {
134 await secretStorage.store(ZOO_CODE_USER_IMAGE_KEY, info.image)
135 _cachedUserImage = info.image
136 } else if (info.image === null) {
137 await secretStorage.delete(ZOO_CODE_USER_IMAGE_KEY)
138 _cachedUserImage = undefined
139 }
140}
141
142export async function clearZooCodeUserInfo(): Promise<void> {
143 if (!secretStorage) return

Callers 2

handleUriFunction · 0.90

Calls 2

storeMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected