mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🔒 fix: resolve session persistence post password reset (#5077)
* ✨ feat: Implement session management with CRUD operations and integrate into user workflows * ✨ refactor: Update session model import paths and enhance session creation logic in AuthService * ✨ refactor: Validate session and user ID formats in session management functions * ✨ style: Enhance UI components with improved styling and accessibility features * chore: Update login form tests to use getByTestId instead of getByRole, remove console.log() * chore: Update login form tests to use getByTestId instead of getByRole --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
9bca2ae953
commit
bdb222d5f4
17 changed files with 402 additions and 116 deletions
|
|
@ -1,5 +1,11 @@
|
|||
import connectDb from '@librechat/backend/lib/db/connectDb';
|
||||
import { deleteMessages, deleteConvos, User, Session, Balance } from '@librechat/backend/models';
|
||||
import {
|
||||
deleteMessages,
|
||||
deleteConvos,
|
||||
User,
|
||||
deleteAllUserSessions,
|
||||
Balance,
|
||||
} from '@librechat/backend/models';
|
||||
import { Transaction } from '@librechat/backend/models/Transaction';
|
||||
type TUser = { email: string; password: string };
|
||||
|
||||
|
|
@ -26,7 +32,8 @@ export default async function cleanupUser(user: TUser) {
|
|||
console.log(`🤖: ✅ Deleted ${deletedMessages} remaining message(s)`);
|
||||
}
|
||||
|
||||
await Session.deleteAllUserSessions(user);
|
||||
// TODO: fix this to delete all user sessions with the user's email
|
||||
await deleteAllUserSessions(user);
|
||||
|
||||
await User.deleteMany({ _id: user });
|
||||
await Balance.deleteMany({ user });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue