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

Function decodeOTPValue

apps/sim/lib/core/security/otp.ts:66–71  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

64}
65
66export function decodeOTPValue(value: string): { otp: string; attempts: number } {
67 const lastColon = value.lastIndexOf(':')
68 if (lastColon === -1) return { otp: value, attempts: 0 }
69 const attempts = Number.parseInt(value.slice(lastColon + 1), 10)
70 return { otp: value.slice(0, lastColon), attempts: Number.isNaN(attempts) ? 0 : attempts }
71}
72
73/**
74 * Stores an OTP for a deployment+email pair, choosing Redis or the

Callers 3

route.tsFile · 0.90
route.tsFile · 0.90
incrementOTPAttemptsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected