aboutsummaryrefslogtreecommitdiff
path: root/rust/src/main.rs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-09-17 23:57:46 +0200
committerTom Smeding <tom.smeding@gmail.com>2021-01-28 22:20:13 +0100
commit653c5d682fb23a57cb39255da0164636ddefb7ab (patch)
tree6e8fd948bfb9579a8215c0892b3c12c77bdf007b /rust/src/main.rs
parentb453b8f7d510940da2fb3b5c1c88f8ba2caa2012 (diff)
rust: Proper authentication data generation
Diffstat (limited to 'rust/src/main.rs')
-rw-r--r--rust/src/main.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/rust/src/main.rs b/rust/src/main.rs
index 6e10938..5a50f3b 100644
--- a/rust/src/main.rs
+++ b/rust/src/main.rs
@@ -18,6 +18,8 @@ use unicode_width::UnicodeWidthChar;
use crate::editor::Editor;
use crate::error::IntoIOError;
+mod auth;
+mod bel;
mod editor;
mod error;
@@ -537,8 +539,10 @@ async fn async_main() -> io::Result<()> {
let addr = ("127.0.0.1", 29538);
let (conn, pushchan) = Connection::connect(connection::Type::Plain, addr).await?;
- let user = Word::try_from(String::from("tom")).unwrap();
- let pass = Line::try_from(String::from("kaas")).unwrap();
+ let (user, pass) = auth::get_auth_info()?;
+
+ let user = Word::try_from(user.to_string()).unwrap();
+ let pass = Line::try_from(pass.to_string()).unwrap();
send_command(&conn, Command::Register { username: user.clone(), password: pass.clone() }).await?;