aboutsummaryrefslogtreecommitdiffstats
path: root/teleterm/src/cmd
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-27 14:42:46 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-27 15:19:47 -0500
commit17449283628c76c0cbaa8c723750ff80aafdd7da (patch)
treee9ecae60bc01f3753366b910050c35f4b270fc44 /teleterm/src/cmd
parent92bf64ce74050545c96694c8d34202b1546ab390 (diff)
downloadteleterm-17449283628c76c0cbaa8c723750ff80aafdd7da.tar.gz
teleterm-17449283628c76c0cbaa8c723750ff80aafdd7da.zip
pull auth_client out into its own field
it doesn't hurt anything even though it's not super necessary for plain logins, and it's more convenient to access without needing to deconstruct the enum value
Diffstat (limited to 'teleterm/src/cmd')
-rw-r--r--teleterm/src/cmd/stream.rs8
-rw-r--r--teleterm/src/cmd/watch.rs10
2 files changed, 13 insertions, 5 deletions
diff --git a/teleterm/src/cmd/stream.rs b/teleterm/src/cmd/stream.rs
index 92026f1..4c3f229 100644
--- a/teleterm/src/cmd/stream.rs
+++ b/teleterm/src/cmd/stream.rs
@@ -38,7 +38,6 @@ impl crate::config::Config for Config {
crate::protocol::AuthType::RecurseCenter => {
let id = crate::oauth::load_client_auth_id(self.client.auth);
crate::protocol::Auth::recurse_center(
- crate::protocol::AuthClient::Cli,
id.as_ref().map(std::string::String::as_str),
)
}
@@ -144,7 +143,12 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static>
) -> Self {
let term_type =
std::env::var("TERM").unwrap_or_else(|_| "".to_string());
- let client = crate::client::Client::stream(&term_type, connect, auth);
+ let client = crate::client::Client::stream(
+ &term_type,
+ connect,
+ auth,
+ crate::protocol::AuthClient::Cli,
+ );
// TODO: tokio::io::stdin is broken (it's blocking)
// see https://github.com/tokio-rs/tokio/issues/589
diff --git a/teleterm/src/cmd/watch.rs b/teleterm/src/cmd/watch.rs
index dc80d47..7e6cb2d 100644
--- a/teleterm/src/cmd/watch.rs
+++ b/teleterm/src/cmd/watch.rs
@@ -36,7 +36,6 @@ impl crate::config::Config for Config {
crate::protocol::AuthType::RecurseCenter => {
let id = crate::oauth::load_client_auth_id(self.client.auth);
crate::protocol::Auth::recurse_center(
- crate::protocol::AuthClient::Cli,
id.as_ref().map(std::string::String::as_str),
)
}
@@ -212,8 +211,12 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static>
) -> Self {
let term_type =
std::env::var("TERM").unwrap_or_else(|_| "".to_string());
- let list_client =
- crate::client::Client::list(&term_type, make_connector(), auth);
+ let list_client = crate::client::Client::list(
+ &term_type,
+ make_connector(),
+ auth,
+ crate::protocol::AuthClient::Cli,
+ );
Self {
term_type,
@@ -332,6 +335,7 @@ impl<S: tokio::io::AsyncRead + tokio::io::AsyncWrite + Send + 'static>
&self.term_type,
(self.make_connector)(),
&self.auth,
+ crate::protocol::AuthClient::Cli,
id,
);
self.state.watching(client);