mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
🔒 fix: Robust Cache Reset on User Logout (#1324)
* refactor(Logout): rely on hooks for mutation behavior * fix: logging out now correctly resets cache, disallowing any cache mixing between the next logged in user on the same browser * chore: remove additional localStorage values on logout
This commit is contained in:
parent
583e978a82
commit
968b8ccdbd
10 changed files with 109 additions and 90 deletions
|
|
@ -7,18 +7,10 @@ const Logout = forwardRef(() => {
|
|||
const { logout } = useAuthContext();
|
||||
const localize = useLocalize();
|
||||
|
||||
const handleLogout = () => {
|
||||
localStorage.removeItem('lastConversationSetup');
|
||||
localStorage.removeItem('lastSelectedTools');
|
||||
localStorage.removeItem('lastAssistant');
|
||||
localStorage.removeItem('autoScroll');
|
||||
logout();
|
||||
};
|
||||
|
||||
return (
|
||||
<button
|
||||
className="flex w-full cursor-pointer items-center gap-3 px-3 py-3 text-sm text-white transition-colors duration-200 hover:bg-gray-700"
|
||||
onClick={handleLogout}
|
||||
onClick={() => logout()}
|
||||
>
|
||||
<LogOutIcon />
|
||||
{localize('com_nav_log_out')}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue