async fn gen_auth_response(&self, auth_req: AuthReq) -> Result<String> {
        let auth_granted = self.authenticate(auth_req).await.map_err(|err| {
            Error::AuthenticatorError(format!(
                "Failed to authorise application on the network: {}",
                err
            ))
        })?;

        debug!("Encoding response with auth credentials auth granted...");
        let resp = serde_json::to_string(&IpcMsg::Resp(IpcResp::Auth(Ok(auth_granted)))).map_err(
            |err| Error::AuthenticatorError(format!("Failed to encode response: {:?}", err)),
        )?;

        debug!("Returning auth response generated");

        Ok(resp)
    }
// Helper function to generate an app authorisation response
Helper function to generate an app authorisation response
Helper function to generate an app authorisation response
async fn gen_auth_response(&self, auth_req: AuthReq) -> Result<String> {
        let auth_granted = self.authenticate(auth_req).await.map_err(|err| {
            Error::AuthenticatorError(format!(
                "Failed to authorise application on the network: {}",
                err
            ))
        })?;
        debug!("Encoding response with auth credentials auth granted...");
        let resp = serde_json::to_string(&IpcMsg::Resp(IpcResp::Auth(Ok(auth_granted)))).map_err(
            |err| Error::AuthenticatorError(format!("Failed to encode response: {:?}", err)),
        )?;
        debug!("Returning auth response generated");
        Ok(resp)
    }
async fn gen_auth_response ( & self , auth_req : AuthReq ) -> Result < String > { let auth_granted = self . authenticate ( auth_req ) . await . map_err ( | err | { Error :: AuthenticatorError ( format ! ( " " err ) ) } ) ? ; debug ! ( " " ) ; let resp = serde_json :: to_string ( & IpcMsg :: Resp ( IpcResp :: Auth ( Ok ( auth_granted ) ) ) ) . map_err ( | err | Error :: AuthenticatorError ( format ! ( " " err ) ) , ) ? ; debug ! ( " " ) ; Ok ( resp ) }
Helper function to generate an app authorisation response
Helper function to generate an app authorisation response
&self
auth_req
AuthReq