Commit 6f20e1a9 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui
Browse files

login: show an error when the credentials are incorrect

parent 830e6492
Pipeline #149445 passed with stages
in 18 minutes and 13 seconds
......@@ -243,6 +243,7 @@ impl Application {
}
}
Err(err) => {
send!(sender, Action::Notify("Failed to log in".to_string()));
send!(sender, Action::SetView(View::Syncing(false)));
error!("Failed to setup a new client from current config: {}", err);
}
......
......@@ -91,9 +91,8 @@ impl ClientManager {
pub async fn set_config(&mut self, config: wallabag_api::types::Config) -> Result<(), Error> {
let client = Client::new(config);
self.client = Some(Arc::new(Mutex::new(client)));
if let Ok(user) = self.fetch_user().await {
self.user.replace(Arc::new(Mutex::new(user)));
}
let user = self.fetch_user().await?;
self.user.replace(Arc::new(Mutex::new(user)));
Ok(())
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment