← Code LabReact Native0/50 solved · 0%
Security · medium

29. Gating secret access with biometrics

Only reveal a secret after successful auth.

Write `async function revealSecret(authenticate, getSecret)` where `authenticate` is an async function returning a boolean; return the secret from `getSecret()` only if `authenticate()` resolves true, otherwise throw `new Error("authentication failed")`.
Required in your answer: await authenticatethrow new Error