mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-22 16:48:30 +02:00
Actually handle "enabled" checkbox on auth form
This commit is contained in:
@@ -534,19 +534,18 @@ impl PluginManager {
|
|||||||
.ok_or(PluginNotFoundErr(auth_name.into()))?;
|
.ok_or(PluginNotFoundErr(auth_name.into()))?;
|
||||||
|
|
||||||
let context_id = format!("{:x}", md5::compute(request_id.to_string()));
|
let context_id = format!("{:x}", md5::compute(request_id.to_string()));
|
||||||
self
|
self.send_to_plugin_and_wait(
|
||||||
.send_to_plugin_and_wait(
|
&WindowContext::from_window(window),
|
||||||
&WindowContext::from_window(window),
|
&plugin,
|
||||||
&plugin,
|
&InternalEventPayload::CallHttpAuthenticationActionRequest(
|
||||||
&InternalEventPayload::CallHttpAuthenticationActionRequest(
|
CallHttpAuthenticationActionRequest {
|
||||||
CallHttpAuthenticationActionRequest {
|
index: action_index,
|
||||||
index: action_index,
|
plugin_ref_id: plugin.clone().ref_id,
|
||||||
plugin_ref_id: plugin.clone().ref_id,
|
args: CallHttpAuthenticationActionArgs { context_id, values },
|
||||||
args: CallHttpAuthenticationActionArgs { context_id, values },
|
},
|
||||||
},
|
),
|
||||||
),
|
)
|
||||||
)
|
.await?;
|
||||||
.await?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,6 +555,19 @@ impl PluginManager {
|
|||||||
auth_name: &str,
|
auth_name: &str,
|
||||||
req: CallHttpAuthenticationRequest,
|
req: CallHttpAuthenticationRequest,
|
||||||
) -> Result<CallHttpAuthenticationResponse> {
|
) -> Result<CallHttpAuthenticationResponse> {
|
||||||
|
let disabled = match req.values.get("disabled") {
|
||||||
|
Some(JsonPrimitive::Boolean(v)) => v.clone(),
|
||||||
|
_ => false,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Auth is disabled, so don't do anything
|
||||||
|
if disabled {
|
||||||
|
info!("Not applying disabled auth {:?}", auth_name);
|
||||||
|
return Ok(CallHttpAuthenticationResponse {
|
||||||
|
set_headers: Vec::new(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let handlers = self.get_http_authentication_summaries(window).await?;
|
let handlers = self.get_http_authentication_summaries(window).await?;
|
||||||
let (plugin, _) = handlers
|
let (plugin, _) = handlers
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user