nikivdev/code · error

Touch ID is not available on this OS

Error message

Touch ID is not available on this OS

What it means

Error "Touch ID is not available on this OS" thrown in nikivdev/code.

Source

Thrown at src/env.rs:545

    let now = Local::now();
    let tomorrow = now
        .date_naive()
        .succ_opt()
        .ok_or_else(|| anyhow::anyhow!("failed to calculate next day"))?;
    let naive = tomorrow
        .and_hms_opt(0, 0, 0)
        .ok_or_else(|| anyhow::anyhow!("failed to build midnight time"))?;
    let local_dt = Local
        .from_local_datetime(&naive)
        .single()
        .or_else(|| Local.from_local_datetime(&naive).earliest())
        .ok_or_else(|| anyhow::anyhow!("failed to resolve local midnight"))?;
    Ok(local_dt.with_timezone(&Utc))
}

fn prompt_touch_id() -> Result<()> {
    if !cfg!(target_os = "macos") {
        bail!("Touch ID is not available on this OS");
    }
    if std::env::var("FLOW_NO_TOUCH_ID").is_ok() || !std::io::stdin().is_terminal() {
        bail!("Touch ID prompt requires an interactive terminal");
    }

    let reason = "Flow needs Touch ID to read env vars.";
    let reason = reason.replace('\\', "\\\\").replace('"', "\\\"");
    let script = format!(
        r#"ObjC.import('stdlib');
ObjC.import('Foundation');
ObjC.import('LocalAuthentication');
const context = $.LAContext.alloc.init;
const policy = $.LAPolicyDeviceOwnerAuthenticationWithBiometrics;
const error = Ref();
if (!context.canEvaluatePolicyError(policy, error)) {{
  $.exit(2);
}}
let ok = false;

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/env.rs:545 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/0871866cee604530. Report an issue: GitHub.