MCPcopy Index your code
hub / github.com/simstudioai/sim / deleteOTP

Function deleteOTP

apps/sim/lib/core/security/otp.ts:232–250  ·  view source on GitHub ↗
(
  kind: DeploymentKind,
  deploymentId: string,
  email: string
)

Source from the content-addressed store, hash-verified

230}
231
232export async function deleteOTP(
233 kind: DeploymentKind,
234 deploymentId: string,
235 email: string
236): Promise<void> {
237 const keys = OTP_KEYS[kind]
238 const storageMethod = getStorageMethod()
239
240 if (storageMethod === 'redis') {
241 const redis = getRedisClient()
242 if (!redis) throw new Error('Redis configured but client unavailable')
243 await redis.del(keys.redisKey(email, deploymentId))
244 return
245 }
246
247 await db
248 .delete(verification)
249 .where(eq(verification.identifier, keys.dbIdentifier(email, deploymentId)))
250}

Callers 2

route.tsFile · 0.90
route.tsFile · 0.90

Calls 4

getStorageMethodFunction · 0.90
getRedisClientFunction · 0.90
deleteMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected