Clear storage after logout
This commit is contained in:
		
					parent
					
						
							
								b55aa12100
							
						
					
				
			
			
				commit
				
					
						6e91ec3a0e
					
				
			
		
					 2 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -254,6 +254,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const logout = useCallback(async () => {
 | 
					  const logout = useCallback(async () => {
 | 
				
			||||||
    await client.logout(undefined, true);
 | 
					    await client.logout(undefined, true);
 | 
				
			||||||
 | 
					    await client.clearStores();
 | 
				
			||||||
    clearSession();
 | 
					    clearSession();
 | 
				
			||||||
    setState({
 | 
					    setState({
 | 
				
			||||||
      client: undefined,
 | 
					      client: undefined,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -84,7 +84,7 @@ export async function initClient(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const storeOpts = {} as ICreateClientOpts;
 | 
					  const storeOpts = {} as ICreateClientOpts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (indexedDB && localStorage && !import.meta.env.DEV) {
 | 
					  if (indexedDB && localStorage /*&& !import.meta.env.DEV*/) {
 | 
				
			||||||
    storeOpts.store = new IndexedDBStore({
 | 
					    storeOpts.store = new IndexedDBStore({
 | 
				
			||||||
      indexedDB: window.indexedDB,
 | 
					      indexedDB: window.indexedDB,
 | 
				
			||||||
      localStorage,
 | 
					      localStorage,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue