summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-12-03 08:46:31 +0300
committerVika <vika@fireburn.ru>2024-12-03 08:46:31 +0300
commit5f45525ad06c87d28c845204b75c0e6b70ba0320 (patch)
treefc9390f7217c5695140d8cf6b6efcc6a36d397d7 /src/lib.rs
parentef6b0f6ee3b769356f7bc852eb240e26f2d895cf (diff)
downloadbowl-5f45525ad06c87d28c845204b75c0e6b70ba0320.tar.zst
Small tweaks for compatibility with Kittybox's inconsistent implementation
I need to fix that, but that'll take a small refactor of Kittybox. I
want things to work and be liberal in what I accept, so I put in some
shortcuts.
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) => {