v0.7.1 minor bug fixes

This commit is contained in:
2026-03-11 14:37:49 -04:00
parent fd041ea95a
commit a1f0c35e8d
10 changed files with 43 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "jama-backend",
"version": "0.7.0",
"version": "0.7.1",
"description": "TeamChat backend server",
"main": "src/index.js",
"scripts": {

View File

@@ -7,7 +7,7 @@ Welcome to **JAMA** — your private, self-hosted team messaging app.
## Security
### 🛡️ Your Privacy Assured
The only people that can read your direct messages (person 2 person or group) are the members of the message group. No one else, including admins, know which message groups exist or which you are part of, unless they are a member.
The only people that can read your direct messages (**person 2 person** or **group**) are the members of the message group. No one else, including admins, know which message groups exist or which you are part of, unless they are a member.
**Every user**, at minimum, can read all public messages.
@@ -50,11 +50,14 @@ Hover over any message and click the **emoji** button to react with an emoji.
Two ways to start a private conversation with one person:
_**New Chat Button**_
1. Click the **New Chat** icon in the sidebar
2. Select one user from the list
3. Click **Start Conversation**
4. Click the users avatar in a message to bring up the profile
5. Click **Direct Message**
_**Message Window**_
1. Click the users avatar in a message window to bring up the profile
2. Click **Direct Message**
---

View File

@@ -30,7 +30,7 @@ app.use(cookieParser());
app.use('/uploads', express.static('/app/uploads'));
// API Routes
app.use('/api/auth', require('./routes/auth'));
app.use('/api/auth', require('./routes/auth')(io));
app.use('/api/users', require('./routes/users'));
app.use('/api/groups', require('./routes/groups')(io));
app.use('/api/messages', require('./routes/messages'));

View File

@@ -1,9 +1,11 @@
const express = require('express');
const bcrypt = require('bcryptjs');
const router = express.Router();
const { getDb, getOrCreateSupportGroup } = require('../models/db');
const { generateToken, authMiddleware, setActiveSession, clearActiveSession } = require('../middleware/auth');
module.exports = function(io) {
const router = express.Router();
// Login
router.post('/login', (req, res) => {
const { email, password, rememberMe } = req.body;
@@ -27,6 +29,10 @@ router.post('/login', (req, res) => {
const token = generateToken(user.id);
const ua = req.headers['user-agent'] || '';
const device = setActiveSession(user.id, token, ua); // displaces prior session on same device class
// Kick any live socket on the same device class — it now holds a stale token
if (io) {
io.to(`user:${user.id}`).emit('session:displaced', { device });
}
const { password: _, ...userSafe } = user;
res.json({
@@ -102,4 +108,5 @@ ${message.trim()}`;
res.json({ success: true });
});
module.exports = router;
return router;
};