diff options
Diffstat (limited to 'src/sub_commands/login.rs')
| -rw-r--r-- | src/sub_commands/login.rs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/sub_commands/login.rs b/src/sub_commands/login.rs index e71d431..6f49ba8 100644 --- a/src/sub_commands/login.rs +++ b/src/sub_commands/login.rs | |||
| @@ -17,7 +17,16 @@ pub struct SubCommandArgs { | |||
| 17 | pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { | 17 | pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { |
| 18 | let git_repo = Repo::discover().context("cannot find a git repository")?; | 18 | let git_repo = Repo::discover().context("cannot find a git repository")?; |
| 19 | if command_args.offline { | 19 | if command_args.offline { |
| 20 | login::launch(&git_repo, &args.nsec, &args.password, None, true).await?; | 20 | login::launch( |
| 21 | &git_repo, | ||
| 22 | &args.bunker_uri, | ||
| 23 | &args.bunker_app_key, | ||
| 24 | &args.nsec, | ||
| 25 | &args.password, | ||
| 26 | None, | ||
| 27 | true, | ||
| 28 | ) | ||
| 29 | .await?; | ||
| 21 | Ok(()) | 30 | Ok(()) |
| 22 | } else { | 31 | } else { |
| 23 | #[cfg(not(test))] | 32 | #[cfg(not(test))] |
| @@ -25,7 +34,16 @@ pub async fn launch(args: &Cli, command_args: &SubCommandArgs) -> Result<()> { | |||
| 25 | #[cfg(test)] | 34 | #[cfg(test)] |
| 26 | let client = <MockConnect as std::default::Default>::default(); | 35 | let client = <MockConnect as std::default::Default>::default(); |
| 27 | 36 | ||
| 28 | login::launch(&git_repo, &args.nsec, &args.password, Some(&client), true).await?; | 37 | login::launch( |
| 38 | &git_repo, | ||
| 39 | &args.bunker_uri, | ||
| 40 | &args.bunker_app_key, | ||
| 41 | &args.nsec, | ||
| 42 | &args.password, | ||
| 43 | Some(&client), | ||
| 44 | true, | ||
| 45 | ) | ||
| 46 | .await?; | ||
| 29 | client.disconnect().await?; | 47 | client.disconnect().await?; |
| 30 | Ok(()) | 48 | Ok(()) |
| 31 | } | 49 | } |