aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/rbw-agent/agent.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-10-27 22:16:46 -0400
committerJesse Luehrs <doy@tozt.net>2021-10-27 22:16:46 -0400
commit5d0e308c1c57bea30d2ad9008b6dbc7936d58645 (patch)
tree3c3798d5fb826aeaca62e11d9e56e1e3b610ca2b /src/bin/rbw-agent/agent.rs
parent7b95f7b9d84c44ca273c1a1ce7ab62925d4a5def (diff)
downloadrbw-5d0e308c1c57bea30d2ad9008b6dbc7936d58645.tar.gz
rbw-5d0e308c1c57bea30d2ad9008b6dbc7936d58645.zip
add a separate "register" command to log in with api keys
Diffstat (limited to 'src/bin/rbw-agent/agent.rs')
-rw-r--r--src/bin/rbw-agent/agent.rs21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/bin/rbw-agent/agent.rs b/src/bin/rbw-agent/agent.rs
index 7ca519b..fae8c7b 100644
--- a/src/bin/rbw-agent/agent.rs
+++ b/src/bin/rbw-agent/agent.rs
@@ -133,24 +133,13 @@ async fn handle_request(
}
};
let set_timeout = match &req.action {
- rbw::protocol::Action::Login => {
- crate::actions::login(
- sock,
- state.clone(),
- req.tty.as_deref(),
- false,
- )
- .await?;
+ rbw::protocol::Action::Register => {
+ crate::actions::register(sock, req.tty.as_deref()).await?;
true
}
- rbw::protocol::Action::LoginApiKey => {
- crate::actions::login(
- sock,
- state.clone(),
- req.tty.as_deref(),
- true,
- )
- .await?;
+ rbw::protocol::Action::Login => {
+ crate::actions::login(sock, state.clone(), req.tty.as_deref())
+ .await?;
true
}
rbw::protocol::Action::Unlock => {