Browse Source

add code to remove jellyfin localStorage item after logout (#1609)

CauseFX 5 years ago
parent
commit
81d5aa8399
1 changed files with 12 additions and 2 deletions
  1. 12 2
      js/functions.js

+ 12 - 2
js/functions.js

@@ -4666,8 +4666,18 @@ function setSSO(){
 		if(v !== false){
 			local('set', i, v);
 		}else{
-		    local('r', i);
-        }
+			local('r', i);
+		}
+	});
+	// other items to remove
+	$.each(localStorage, function(i,v) {
+		if(typeof v == 'string'){
+			if(i.startsWith('user-')){
+				if(typeof activeInfo.sso[i] == 'undefined'){
+					local('r', i);
+				}
+			}
+		}
 	});
 }
 function buildStreamItem(array,source){