Skip to content

Commit

Permalink
Log lnurl auth errors
Browse files Browse the repository at this point in the history
Was testing some lnurl auth stuff and found these helpful
  • Loading branch information
benthecarman committed May 25, 2023
1 parent d54c0f0 commit 7934b4f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions mutiny-core/src/nodemanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,17 +1311,25 @@ impl<S: MutinyStorage> NodeManager<S> {
let k1: [u8; 32] = FromHex::from_hex(k1).map_err(|_| MutinyError::LnUrlFailure)?;
let (sig, key) = self.auth.sign(profile_index, url.clone(), &k1)?;

let response = self.lnurl_client.lnurl_auth(lnurl, sig, key).await?;
let response = self.lnurl_client.lnurl_auth(lnurl, sig, key).await;
match response {
Response::Ok { .. } => {
Ok(Response::Ok { .. }) => {
// don't fail if we just can't save the service
if let Err(e) = self.auth.add_used_service(profile_index, url) {
log_error!(self.logger, "Failed to save used lnurl auth service: {e}");
}

log_info!(self.logger, "LNURL auth successful!");
Ok(())
}
Response::Error { .. } => Err(MutinyError::LnUrlFailure),
Ok(Response::Error { reason }) => {
log_error!(self.logger, "LNURL auth failed: {reason}");
Err(MutinyError::LnUrlFailure)
}
Err(e) => {
log_error!(self.logger, "LNURL auth failed: {e}");
Err(MutinyError::LnUrlFailure)
}
}
}

Expand Down

0 comments on commit 7934b4f

Please sign in to comment.