diff options
Diffstat (limited to 'src/login.rs')
| -rw-r--r-- | src/login.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/login.rs b/src/login.rs index b0fe230..4cdf3c1 100644 --- a/src/login.rs +++ b/src/login.rs | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | use std::str::FromStr; | ||
| 2 | |||
| 1 | use anyhow::{bail, Context, Result}; | 3 | use anyhow::{bail, Context, Result}; |
| 2 | use nostr::{prelude::FromSkStr, secp256k1::XOnlyPublicKey}; | 4 | use nostr::PublicKey; |
| 3 | use zeroize::Zeroize; | 5 | use zeroize::Zeroize; |
| 4 | 6 | ||
| 5 | #[cfg(not(test))] | 7 | #[cfg(not(test))] |
| @@ -25,7 +27,7 @@ pub async fn launch( | |||
| 25 | // if nsec parameter | 27 | // if nsec parameter |
| 26 | let key = if let Some(nsec_unwrapped) = nsec { | 28 | let key = if let Some(nsec_unwrapped) = nsec { |
| 27 | // get key or fail without prompts | 29 | // get key or fail without prompts |
| 28 | let key = nostr::Keys::from_sk_str(nsec_unwrapped).context("invalid nsec parameter")?; | 30 | let key = nostr::Keys::from_str(nsec_unwrapped).context("invalid nsec parameter")?; |
| 29 | 31 | ||
| 30 | // if password, add user to enable password login in future | 32 | // if password, add user to enable password login in future |
| 31 | if password.is_some() { | 33 | if password.is_some() { |
| @@ -91,7 +93,7 @@ pub async fn launch( | |||
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | async fn get_user_details( | 95 | async fn get_user_details( |
| 94 | public_key: &XOnlyPublicKey, | 96 | public_key: &PublicKey, |
| 95 | #[cfg(test)] client: &crate::client::MockConnect, | 97 | #[cfg(test)] client: &crate::client::MockConnect, |
| 96 | #[cfg(not(test))] client: &Client, | 98 | #[cfg(not(test))] client: &Client, |
| 97 | ) -> Result<UserRef> { | 99 | ) -> Result<UserRef> { |