mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-17 18:21:26 +02:00
Fix auth tab crash when template rendering fails
Use ReturnEmpty instead of Throw for render errors in cmd_get_http_authentication_config, since this is a preview path. Invalid templates in auth fields (e.g. OAuth 2) will now render as empty strings instead of crashing the auth config panel. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1095,8 +1095,13 @@ async fn cmd_get_http_authentication_config<R: Runtime>(
|
|||||||
|
|
||||||
// Convert HashMap<String, JsonPrimitive> to serde_json::Value for rendering
|
// Convert HashMap<String, JsonPrimitive> to serde_json::Value for rendering
|
||||||
let values_json: serde_json::Value = serde_json::to_value(&values)?;
|
let values_json: serde_json::Value = serde_json::to_value(&values)?;
|
||||||
let rendered_json =
|
let rendered_json = render_json_value(
|
||||||
render_json_value(values_json, environment_chain, &cb, &RenderOptions::throw()).await?;
|
values_json,
|
||||||
|
environment_chain,
|
||||||
|
&cb,
|
||||||
|
&RenderOptions { error_behavior: RenderErrorBehavior::ReturnEmpty },
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
|
||||||
// Convert back to HashMap<String, JsonPrimitive>
|
// Convert back to HashMap<String, JsonPrimitive>
|
||||||
let rendered_values: HashMap<String, JsonPrimitive> = serde_json::from_value(rendered_json)?;
|
let rendered_values: HashMap<String, JsonPrimitive> = serde_json::from_value(rendered_json)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user