Enhance security by preventing the creation of default admin credentials in chat-users.json. Update chat.js to ensure command output does not pollute conversation history, and add chat-users.json to .gitignore to prevent tracking of sensitive user data.
This commit is contained in:
@@ -293,23 +293,11 @@ export const useChatStore = defineStore('chat', () => {
|
||||
break;
|
||||
case 'commandResult': {
|
||||
const lines = Array.isArray(data.lines) ? data.lines : [];
|
||||
if (!currentConversation.value) {
|
||||
errorMessage.value = lines.join(' | ');
|
||||
setTimeout(() => {
|
||||
errorMessage.value = null;
|
||||
}, 5000);
|
||||
break;
|
||||
}
|
||||
const timestamp = new Date().toISOString();
|
||||
for (const line of lines) {
|
||||
messages.value.push({
|
||||
from: 'System',
|
||||
message: String(line),
|
||||
timestamp,
|
||||
self: false,
|
||||
isImage: false
|
||||
});
|
||||
}
|
||||
// Command output is global and must not pollute per-conversation history.
|
||||
errorMessage.value = lines.join(' | ');
|
||||
setTimeout(() => {
|
||||
errorMessage.value = null;
|
||||
}, 5000);
|
||||
break;
|
||||
}
|
||||
case 'unreadChats':
|
||||
|
||||
Reference in New Issue
Block a user