plum-e2e 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,12 +40,24 @@ function jwtAuth(req, res, next) {
40
40
  if (!auth || !auth.startsWith('Bearer ')) {
41
41
  return res.status(401).json({ error: 'Unauthorized' });
42
42
  }
43
+ let payload;
43
44
  try {
44
- req.user = verifyToken(auth.slice(7));
45
- next();
45
+ payload = verifyToken(auth.slice(7));
46
46
  } catch {
47
47
  return res.status(401).json({ error: 'Invalid or expired token' });
48
48
  }
49
+ // Confirm the user still exists — catches stale JWTs after a DB reset
50
+ prisma.user
51
+ .findUnique({ where: { id: payload.userId }, select: { id: true } })
52
+ .then((user) => {
53
+ if (!user) return res.status(401).json({ error: 'Session expired. Please log in again.' });
54
+ req.user = payload;
55
+ next();
56
+ })
57
+ .catch(() => {
58
+ req.user = payload;
59
+ next();
60
+ });
49
61
  }
50
62
 
51
63
  module.exports = { jwtAuth };
package/bin/plum.js CHANGED
@@ -318,9 +318,9 @@ async function serverStart() {
318
318
  }
319
319
  }
320
320
 
321
- clack.log.info(pc.dim('Streaming logs (Ctrl+C to detach — server keeps running):'));
322
- execSync('docker compose logs -f', { cwd: plumRoot, stdio: 'inherit' });
323
- clack.outro(pc.dim('Detached from logs. Run "docker compose down" to stop.'));
321
+ clack.log.info(`UI: ${pc.cyan(`http://localhost:${cfg.frontendPort}`)}`);
322
+ clack.log.info(`API: ${pc.cyan(`http://localhost:${cfg.backendPort}`)}`);
323
+ clack.outro(pc.green('Plum is running. Use "plum server stop" to shut down.'));
324
324
  }
325
325
 
326
326
  async function serverReconfig() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plum-e2e",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/silverlunah/plum.git"