summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6048e10..fc50b52 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -260,6 +260,7 @@ impl App {
 
                 // Skip the token if we can't access ?q=config
                 if let Err(micropub::Error::Micropub(err)) = micropub.config().await {
+                    tracing::warn!("Micropub token seems to be invalid. Let's try refreshing.");
                     if err.error == kittybox_util::micropub::ErrorKind::NotAuthorized {
                         // Token may have expired. See if we have a refresh token and renew.
                         let _ = libsecret::password_clear_future(Some(schema), attrs_ref).await;
@@ -473,12 +474,11 @@ impl AsyncComponent for App {
     ) {
         match message {
             Input::SignOut => {
-                if self.micropub.take().is_some() {
+                if let Some(micropub) = self.micropub.take() {
                     let _ = libsecret::password_clear_future(
                         Some(&self.secret_schema),
                         Default::default(),
                     ).await;
-                    self.micropub = None;
                 }
             },
             Input::Authorize(data) => {