diff --git a/packages/file-handling/src/nextcloud-file-picker.js b/packages/file-handling/src/nextcloud-file-picker.js
index 9b108fb29256e900a7cc1a2d722c5ffe9fece061..3daa45dc456e403dc9264244ed729862b75308af 100644
--- a/packages/file-handling/src/nextcloud-file-picker.js
+++ b/packages/file-handling/src/nextcloud-file-picker.js
@@ -417,16 +417,22 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
     }
 
 
-
     /**
      *
      */
     async checkLocalStorage() {
-        if (!this.isLoggedIn() || !this.auth)
+        if (!this.isLoggedIn() || !this.auth) {
+            for (let [key, value] of Object.entries(localStorage)) {
+                if (key.includes("nextcloud-webdav-username-") || key.includes("nextcloud-webdav-password-")) {
+                    localStorage.removeItem(key);
+                }
+            }
             return;
+        }
         const publicId = this.auth['person-id'];
         const token = parseJwt(this.auth.token);
         const sessionId = token ? token.sid : "";
+
         if (this.storeSession && sessionId
             && localStorage.getItem('nextcloud-webdav-username-' + publicId)
             && localStorage.getItem('nextcloud-webdav-password-' + publicId) ){
@@ -451,6 +457,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
         }
     }
 
+
     /**
      * check mime type of row
      *