( kind: DeploymentKind, deploymentId: string, email: string )
| 230 | } |
| 231 | |
| 232 | export 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 | } |
no test coverage detected