{"record":{"id":"0871866cee604530","repo":"nikivdev/code","slug":"touch-id-is-not-available-on-this-os","errorCode":null,"errorMessage":"Touch ID is not available on this OS","messagePattern":"Touch ID is not available on this OS","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/env.rs","lineNumber":545,"sourceCode":"    let now = Local::now();\n    let tomorrow = now\n        .date_naive()\n        .succ_opt()\n        .ok_or_else(|| anyhow::anyhow!(\"failed to calculate next day\"))?;\n    let naive = tomorrow\n        .and_hms_opt(0, 0, 0)\n        .ok_or_else(|| anyhow::anyhow!(\"failed to build midnight time\"))?;\n    let local_dt = Local\n        .from_local_datetime(&naive)\n        .single()\n        .or_else(|| Local.from_local_datetime(&naive).earliest())\n        .ok_or_else(|| anyhow::anyhow!(\"failed to resolve local midnight\"))?;\n    Ok(local_dt.with_timezone(&Utc))\n}\n\nfn prompt_touch_id() -> Result<()> {\n    if !cfg!(target_os = \"macos\") {\n        bail!(\"Touch ID is not available on this OS\");\n    }\n    if std::env::var(\"FLOW_NO_TOUCH_ID\").is_ok() || !std::io::stdin().is_terminal() {\n        bail!(\"Touch ID prompt requires an interactive terminal\");\n    }\n\n    let reason = \"Flow needs Touch ID to read env vars.\";\n    let reason = reason.replace('\\\\', \"\\\\\\\\\").replace('\"', \"\\\\\\\"\");\n    let script = format!(\n        r#\"ObjC.import('stdlib');\nObjC.import('Foundation');\nObjC.import('LocalAuthentication');\nconst context = $.LAContext.alloc.init;\nconst policy = $.LAPolicyDeviceOwnerAuthenticationWithBiometrics;\nconst error = Ref();\nif (!context.canEvaluatePolicyError(policy, error)) {{\n  $.exit(2);\n}}\nlet ok = false;","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/env.rs#L527-L563","documentation":"Error \"Touch ID is not available on this OS\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/env.rs:545 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}